On Tue, Sep 28, 2010 at 9:30 AM, Struve, Juliane <j.str...@imperial.ac.uk> wrote: > > Hi, > > in this self-contained example the file the same error message appears as > when I read in my original results files. > > library (zoo) > library(chron) > #generate example data > Fish_ID=1646 > Date <- "01/01/2004 00:01:00" > Date <- as.POSIXct(strptime(Date,format="%m/%d/%Y %H:%M:%S")) > R2sqrt <-100 > #put into dataframe > Test <- data.frame(Fish_ID=Fish_ID,Date=Date,R2sqrt=R2sqrt) > # write .csv file > write.csv(Test,file="Test") > #generate list of files > filenames="Test" > #read file(s) into zoo object > read.zoo(file=filenames, header = TRUE, FUN = as.chron, sep = ",", colClasses > = c("NULL", "NULL", "character", "numeric")) #works fine > #read list of files into zoo.object > lapply(filenames, read.zoo, header = TRUE, FUN = as.chron, sep = ",", > colClasses = c("NULL", "NULL", "character", "numeric"))# error > "Error in strptime(x, format, tz = tz) : invalid 'x' argument" > > Am I missing something ? > > Thank you for your time and patience.
Self contained means anyone else can just copy your code and paste it into their session and see the error message you see. Its likely that your file does not contain what you think it does. -- Statistics & Software Consulting GKX Group, GKX Associates Inc. tel: 1-877-GKX-GROUP email: ggrothendieck at gmail.com ______________________________________________ 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.