#install the package ggplot2 install.packages("ggplot2") #activate the package ggplot2 library(ggplot2) y <- c(45,12,48,79,65,32,78,95,12,75) x <- c(1,2,3,4,5,6,7,8,9,10) my.dataframe<-data.frame(y,x) my.dataframe #draw the simplest plot ever with qplot() qplot(x, y) #draw the simplest plot ever with ggplot() ggplot(my.dataframe, aes(x,y)) + geom_point() ggplot(my.dataframe, aes(x,y)) + geom_col() #oops I have forgotten the geometry ggplot(my.dataframe, aes(x,y)) + geom_point() #oops I have forgotten the aesthetics ggplot(my.dataframe) + geom_point() #oops I have forgotten the dataframe ggplot(aes(x,y)) + geom_point() x <- 1:15 y <- x*x-2*x plot(x,y, xlab="Title for X-axis", ylab="Title for Y-axis", cex=1.5, cex.lab=1.4, cex.axis=1.2, col.lab="blue") lines(x, y, type="c", col="green" ) lines(x, y, type="h", col= "red")