[R] plotting multiple animal tracks against Date/Time
Gabor Grothendieck
ggrothendieck at gmail.com
Wed Sep 29 01:09:07 CEST 2010
On Tue, Sep 28, 2010 at 9:30 AM, Struve, Juliane
<j.struve at 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
More information about the R-help
mailing list