Hi all,
I have a file with a dozen weather stations with a dozen weather variables. I am trying to get a percentile of each variable for each station. I imported the file into a data frame Data. To get the percentile for Temperature for Baxley weather station, I used the following 2 statements. > BaxleyList[1] <- data.frame(quantile(subset(Data, (Name=='Baxley' & Temp>-50), select=Temp),probs=seq(0,1,0.01),na.rm=T,names=T)) > colnames(BaxleyList)[1] <- 'Temp' With this success, I want to loop through the station list. But, I ran into problem in the variable name "BaxleyList". I tried the following: #StationNames > StationNameList <- unique(Data$Name) > for (i in 1:1) { ThisStation <- StationNameList[i] ThisStationList <- paste(ThisStation,'List',sep="") ThisStationList[1] <- data.frame(quantile(subset(Data, (Name==ThisStation & Temp>-50), select=Temp),probs=seq(0,1,0.01),na.rm=T,names=T)) colnames(ThisStationList)[1] <- 'Temp' } But, ThisStationList will not give me BaxleyList. Thank you for all your helps in advance! Daniel Chan Meteorologist Georgia Forestry Commission P O Box 819 Macon, GA 31202 Tel: 478-751-3508 Fax: 478-751-3465 [[alternative HTML version deleted]] ______________________________________________ R-help@stat.math.ethz.ch 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.