[AniMov] ...other problems

carlottacanova at tiscali.it carlottacanova at tiscali.it
Mon Feb 14 11:08:28 CET 2005


Hi
thank for your help. 
We have another question about R and we hope you could help us another time:
we have converted the column date to the format POSIXct as you said, but after 
we have the a problem with the conversion of the data to the class traj.

We have our data in a file.txt and we have imported it with

fagiani <-read.table("date_ok.txt", header=TRUE, sep=";", 
colClasses=c("numeric", "numeric", "numeric", "character"))

then we wrote

fagiani$date <- as.POSIXct ( strptime (fagiani$date, format = "%y%m%d"))
> fagiani
    id     x     y       date
1  739 39100 42560 2005-12-04
2  799 39100 42570 2005-12-04
3  908 39100 42570 2005-12-04
4  847 36210 40150 2005-12-04
5  925 36240 40200 2005-12-04
6  986 36060 40230 2005-12-04
7  847 36230 40110 2005-12-04
8  986 36050 40240 2005-02-14
9  925 36310 40320 2005-12-04
10 708 36950 40240 2005-12-04
11 749 36950 40240 2005-12-21

> tr <- as.traj(id = id, xy = xy, date = fagiani$date)
Error in if ((as.numeric(x$date))[i] == (as.numeric(x$date))[i - 1]) ind[i] <- 
1 :
        missing value where TRUE/FALSE needed

Do you have any suggestion?
All the best

  Carlotta Canova



More information about the AniMov mailing list