Closed VCF closed 5 years ago
My terminal claims it can't find the ggplot2 package:
Error in library(ggplot2) : there is no package called ‘ggplot2’
Otherwise, I think I'm pretty much good.
That means you haven't installed it yet. Try:
install.packages("ggplot2")
## And remember to use any package, your code should pull it in with library, which
## is generally put at the top of your code.
library("ggplot2")
You have a typo in 5393e8a - look at the error that's being thrown to get a hint of where it is.
Ok, good, fixed in ce5c87d. It looks like you have a good grasp of basic plotting!
R has "built-in" plotting capabilities via
plot
and some other methods. However, they're considered fairly rudimentary, and are usually used to quickly glance at your data. For publication-quality graphics there's a great package calledggplot2
. It can be confusing at first, but it's not too bad once you get over the initially weird syntax.This is a good introduction to the package. Try out the examples, and then see if you can adapt your data to what you've learned.
midwest
)geom_smooth()
components you'll see in the examples. These can be very valuable in highlighting trends or relationships.