I am very new to R and I use it for my probability class. I searched for this question here, but it looks like this is not the same as what I want to do. (If there is an answer, tell me).
The problem is that I want to save several histogram plots in one file. For example, if I do this at the R prompt, I get what I want:
library(PASWR) data(Grades) attach(Grades)
So, I get both histograms in the same plot. but if I want to save it as jpeg:
library(PASWR) data(Grades) attach(Grades) # Grades has gpa and sat variables par(mfrow=c(2,1)) jpeg("hist_gpa_sat.jpg") hist(gpa) hist(sat) dev.off()
It saves the file, but with only one plot ... Why? How can i fix this? Thanks.
In addition, if there is a good article or tutorial on how to build a graph with gplot and related material, this will be appreciated, thanks.
source share