Re: [R] Plotting Histogram using histogram() and for loop and I want to save the histogram individually ... HELP

2009-11-17 Thread ychu066
tried but still doesnt work ... very weird ... ychu066 wrote: here is the codes that i tried. png(paste(hist,i,.png,sep=) + library(lattice) Error: unexpected symbol in: png(paste(hist,i,.png,sep=) library for(i in 8:153){ + histogram(~ data[,i] | data[,2],

Re: [R] Plotting Histogram using histogram() and for loop and I want to save the histogram individually ... HELP

2009-11-17 Thread Tal Galili
I know how you feel, I came a cross the same problem once, which took sometime to find a solution for. What you need to do is put the hist into a variable and then plot it, for example: library(lattice) for(i in 8:153){ hist.to.plot - histogram(~ data[,i] | data[,2],

Re: [R] Plotting Histogram using histogram() and for loop and I want to save the histogram individually ... HELP

2009-11-17 Thread David Winsemius
It's a FAQ. http://cran.r-project.org/doc/FAQ/R-FAQ.html#Why-do-lattice_002ftrellis-graphics-not-work_003f -- David. On Nov 17, 2009, at 7:14 AM, Tal Galili wrote: I know how you feel, I came a cross the same problem once, which took sometime to find a solution for. What you need to do

Re: [R] Plotting Histogram using histogram() and for loop and I want to save the histogram individually ... HELP

2009-11-16 Thread ychu066
still doesnt work ... Karl Ove Hufthammer wrote: On Thu, 12 Nov 2009 19:10:52 -0800 (PST) ychu066 ychu066 @aucklanduni.ac.nz wrote: And I also want to save each histogram in each separate pdf file using the following codes ?. png(hist.png[i]) dev.off() Try

Re: [R] Plotting Histogram using histogram() and for loop and I want to save the histogram individually ... HELP

2009-11-16 Thread ychu066
here is the codes that i tried. png(paste(hist,i,.png,sep=) + library(lattice) Error: unexpected symbol in: png(paste(hist,i,.png,sep=) library for(i in 8:153){ + histogram(~ data[,i] | data[,2], data=data,ylab=Frequency,xlim=c(1,5),xlab=Score,ylim=c(0,100))) Error: unexpected ')' in:

Re: [R] Plotting Histogram using histogram() and for loop and I want to save the histogram individually ... HELP

2009-11-16 Thread Karl Ove Hufthammer
On Mon, 16 Nov 2009 19:54:08 -0800 (PST) ychu066 ychu066 @aucklanduni.ac.nz wrote: here is the codes that i tried. png(paste(hist,i,.png,sep=) + library(lattice) Error: unexpected symbol in: png(paste(hist,i,.png,sep=) library There is a missing ')' at the end of the first line. If

Re: [R] Plotting Histogram using histogram() and for loop and I want to save the histogram individually ... HELP

2009-11-13 Thread Karl Ove Hufthammer
On Thu, 12 Nov 2009 19:10:52 -0800 (PST) ychu066 ychu066 @aucklanduni.ac.nz wrote: And I also want to save each histogram in each separate pdf file using the following codes ?. png(hist.png[i]) dev.off() Try png(paste(hist,i,.png,sep=) instead. -- Karl Ove Hufthammer

[R] Plotting Histogram using histogram() and for loop and I want to save the histogram individually ... HELP

2009-11-12 Thread ychu066
I am trying to write R codes for the histogram plot and saving it out. There will be 146 histogram plots in total…. I have the following R codes that draws the each Histogram …. library(lattice) for(i in 8:153){ histogram(~ data[,i] | data[,2],