PortMadeleineCrumpet
PortMadeleineCrumpet

Reputation: 115

Why cannot increase ylim in basic bar plot?

I am trying to make a bar plot for qualitative variables. In the following situation:

library(ISLR)
df <- College
barplot(table(df$Private))

Why does the count for "yes" fo past the limit of the Y-axis?

library(ISLR)
df <- College
barplot(table(df$Private), ylim=700)

To correct this, why do I get an error for when I try to increase the limit of the y-axis?

Upvotes: 0

Views: 31

Answers (1)

Chris Ruehlemann
Chris Ruehlemann

Reputation: 21400

You need to specify a range from ... to ... . The correct input is:

ylim = c(0, 700)

Feel free to take whatever else instead of 0.

Upvotes: 3

Related Questions