Hi Nasrin, 1) You didn't define mean.radiation in your code (for example using mean.radiation<-NULL) 2) Also, you're using "attach", which is a good recipe for forgetting something in your environment which will lead into troubles. 3) You didn't define i (for example i <- 1:30)
Tal ----------------Contact Details:------------------------------------------------------- Contact me: tal.gal...@gmail.com | 972-52-7275845 Read me: www.talgalili.com (Hebrew) | www.biostatistics.co.il (Hebrew) | www.r-statistics.com (English) ---------------------------------------------------------------------------------------------- On Thu, Nov 4, 2010 at 8:49 PM, Nasrin Pak <astronas...@gmail.com> wrote: > Hi; > I have 30 data sets and I managed to take the average of a variable in each > set and put them in a vector like variable(It contains NaN data as well). > x<- matrix( list.files("C:/updated_CFL_Rad_files/2007/11",full=TRUE)) > for(i in 1:30) { > radiation.data <-read.table(x[i], header = TRUE,sep = ",", quote = " ", > dec = ".") > attach(radiation.data) > names(radiation.data) > mean.radiation[i]<- mean(PAR_avg,na.rm = TRUE) > } > How can I plot this vector (mean.radiation[i]) vs i ? > I tried to do so but there was an error: > Error in plot.window(...) : need finite 'ylim' values > In addition: Warning messages: > 1: In min(x) : no non-missing arguments to min; returning Inf > 2: In max(x) : no non-missing arguments to max; returning -Inf > > -- > Sincerely > > Nasrin Pak > > [[alternative HTML version deleted]] > > ______________________________________________ > R-help@r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide > http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. > [[alternative HTML version deleted]] ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.