Any help in resolving the following errors will be appreciated: > pollutantmean <- function(directory, pollutant, id=1:332) + file_inc <- list.files("specdata", full.names=TRUE) > dat <- data.frame() > for(i in 1:10) { + dat <- rbind(dat, read.csv(file_inc[i])) + } Error in read.table(file = file, header = header, sep = sep, quote = quote, : object 'file_inc' not found > sulfate <- subset(dat( , 2)) Error in subset(dat(, 2)) : could not find function "dat" > nitrate <- subset(dat( , 3)) Error in subset(dat(, 3)) : could not find function "dat" > mean(pollutant) Error in mean(pollutant) : object 'pollutant' not found > save"pollutantmean.R" Error: unexpected string constant in " save"pollutantmean.R""
[[alternative HTML version deleted]] ______________________________________________ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see 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.