Assignment #9: Visualization in R – Base Graphics, Lattice, and ggplot2

 













Base R is for basic functions like plot and histogram. The base function is the simplest compared to the others as it creates a quick graph like plot(x, y). While Lattice and ggplot2 are more difficult and more customizable. Lattice is more complicated as it shows different groups using xyplot(y ~ x | group). Then there is ggplot2 where you keep adding on to it with + and start with ggplot(data, aes(x, y)).

I believe ggplot2 gave me the most control and made the nicest-looking graph that was more colorful than the others. It looks cleaner and nicer compared to the base and lattice. 

It was confusing to switch between the three because they all have different starting codes for example base you just use plot(x, y) and lattice you have to use xyplot(y ~ x | group) and ggplot2 you start with ggplot(data, aes(x, y)) and some of them are harder to read and remember.



Comments

Popular posts from this blog

Assignment #8: Input/Output, String Manipulation, and the plyr Package

Assignment #5: Matrix Algebra in R

Assignment #11: Debugging and Defensive Programming in R