20 Aug 12:33
pdf filenames in while loop
From: Wesley Roberts <wroberts <at> csir.co.za>
Subject: pdf filenames in while loop
Newsgroups: gmane.comp.lang.r.general
Date: 2008-08-20 10:37:45 GMT
Subject: pdf filenames in while loop
Newsgroups: gmane.comp.lang.r.general
Date: 2008-08-20 10:37:45 GMT
Dear R users, I am a remote sensing researcher currently studying the use of LiDAR data for quantifying tree height, in particular I would like to determine the sample size needed to capture and quantify canopy height variability. To do this I have employed the use of automap(), which automatically calculates variograms including reporting the range of the variogram. The program is easy to use and I have had much success with it. However, I have run into a slight problem. My analysis consists of 60 independent plots located in our study area and I wish to run the variogram analyses for each plot and then write the resulting plot to a pdf file. Given that I have 60 plots I would like to vary the name of each file based on the plot being processed, see my code below. I have tried a number of different ap proaches using the paste() command but cant seem to get it to work. Currently, as.character does not seem to solve the problem pdf(file="as.character(paste(f.mat[a])).pdf") alternatively I could write out to JPEG but I would rather not take that approach or I could write all pdf plots to one file but I am not sure how to do this. Could someone suggest a solution? I am using R version 2.7.1 (2008-06-23) on Ubuntu 7.10. Many thanks, Wesley library(gstat) library(automap) ## List of files to be used in the while loop(Continue reading)
RSS Feed