zork1
zork1

Reputation: 69

ggplot with three variables x~axis in r

I am currently trying to create a ggplot with three variables in r, that compares a H-1b support (y~axis) - the variable is h1bvis.supp and implicit bias (x~axis) by gender - the variable is impl.prejud. I have tried to create the plot with the folllowing code:

ggplot(data = immigrant) + geom_histogram(mapping = aes(x = impl.prejud, y = h1bvis.supp))

It is not working and I don't know why.

The dataset is this one:

immigrant <- read.csv("https://raw.githubusercontent.com/umbertomig/intro-prob-stat-FGV/master/datasets/immig.csv")

Upvotes: 2

Views: 252

Answers (1)

Alexis
Alexis

Reputation: 2294

Is this what you need?

immigrant <- read.csv("https://raw.githubusercontent.com/umbertomig/intro-prob-stat-FGV/master/datasets/immig.csv")
ggplot(immigrant, aes(x = impl.prejud, y = h1bvis.supp)) + geom_col()

Upvotes: 2

Related Questions