Hi Folks
I can't see what I have done wrong in this piece of code.
# Read filenames from csv file
files <- read.csv(file="files.csv",head=FALSE,sep=",")
# for each filename read the file
for (i in 1:length(files)) {
# f becomes the next row inthe file
f<-files[i,]
# the header to be used for the graph is in column 2 of f
head=f[2]
par(mfrow=c(4,2))
# the filename to be used is in column 1 of f
con<-read.csv(file=f[1], header=TRUE, sep=',')
tmp<-con$value2
data<-normalize_js(tmp,-1,1)
time<-con$time
# run the waveform analyser
waveformanalyser(data,time,head)
}
I get an error:
Error in read.table(file = file, header = header, sep = sep, quote = quote,
:
'file' must be a character string or connection
When the error occurs f equals:
> f
V1 V2
1 ANA110915004A_3PERIOD_TmAvg-rdata.csv Pre-DA
and f[1] equals:
> f[1]
V1
1 ANA110915004A_3PERIOD_TmAvg-rdata.csv
Why won't it use the value of f[1] as a string for the file parameter in
the read.csv line?
All help would be apprecitated.
Regards
Jannetta
--
===================================
Web site: http://www.jannetta.com
Email: [email protected]
===================================
[[alternative HTML version deleted]]
______________________________________________
[email protected] 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.