I need to create a move-object from a large set of telemetric data (>100,000 rows) for e.g. brownian bridge movement modelling. I spent a lot of time today to be sure about the format of the columns but the move()-function still does not work. This is how the head of my data looks like:
> head(gps)
# A tibble: 6 x 6
id UTC_date UTC_time Lat Long datetime
<dbl> <date> <time> <dbl> <dbl> <dttm>
1 1 2022-03-01 04:32:36 47.6 17.2 2022-03-01 04:32:36
2 2 2022-03-01 05:09:09 47.6 17.2 2022-03-01 05:09:09
3 3 2022-03-01 05:24:36 47.6 17.2 2022-03-01 05:24:36
4 4 2022-03-01 05:39:11 47.6 17.2 2022-03-01 05:39:11
5 5 2022-03-01 05:54:10 47.6 17.2 2022-03-01 05:54:10
6 6 2022-03-01 06:09:07 47.6 17.2 2022-03-01 06:09:07
So this is the code I applied:
> gps.move <- move(x=gps$Long,y=gps$Lat,time=as.POSIXct(gps$datetime, format="%Y-%m-%d %H:%M:%S", tz="UTC"), proj=CRS("+proj=longlat +ellps=WGS84"),sensor='gps',animal='ebr')
Which leads to the following error:
Error in validityMethod(as(object, superClass)) :
There are NA timestamps records
There are no NAs in my dataset and everything looks fine. The format of the datetime column should be ok. So its not the same issue as for question "Attempting to make a Move object in R - NA timestamp records" which has been answered, already.
No idea what more I can do, but so far I can't even start my analyses... So if anybody could help, it would be great!!! Waiting for your ideas, Vincent
according to the comment by akrun, I provide an example of my dataset via
dput(head(gps, 30))
structure(list(id = c(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12,
13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28,
29, 30), UTC_date = structure(c(19052, 19052, 19052, 19052, 19052,
19052, 19052, 19052, 19052, 19052, 19052, 19052, 19052, 19052,
19052, 19052, 19052, 19052, 19052, 19052, 19052, 19052, 19052,
19052, 19052, 19052, 19052, 19052, 19052, 19052), class = "Date"),
UTC_time = structure(c(16356, 18549, 19476, 20351, 21250,
22147, 23044, 23946, 24849, 25762, 26646, 27549, 28475, 29350,
30244, 31144, 32054, 32943, 33843, 34143, 34443, 34748, 35046,
35355, 35646, 35944, 36250, 36549, 36847, 37155), class = c("hms",
"difftime"), units = "secs"), Lat = c(47.640568, 47.640465,
47.640583, 47.634518, 47.634521, 47.634571, 47.628986, 47.615341,
47.616413, 47.615879, 47.610222, 47.610355, 47.610271, 47.601887,
47.590824, 47.630959, 47.667355, 47.661449, 47.657658, 47.663628,
47.665482, 47.67421, 47.682339, 47.690842, 47.68565, 47.684284,
47.680889, 47.683617, 47.687698, 47.70435), Long = c(17.16995,
17.169903, 17.170017, 17.171446, 17.171473, 17.171505, 17.156851,
17.146259, 17.144289, 17.145241, 17.145254, 17.144869, 17.144958,
17.162409, 17.182302, 17.179539, 17.175821, 17.212822, 17.216106,
17.213263, 17.217554, 17.209574, 17.207357, 17.188231, 17.155718,
17.139551, 17.143511, 17.133562, 17.136698, 17.111744), datetime = structure(c(1646105556,
1646107749, 1646108676, 1646109551, 1646110450, 1646111347,
1646112244, 1646113146, 1646114049, 1646114962, 1646115846,
1646116749, 1646117675, 1646118550, 1646119444, 1646120344,
1646121254, 1646122143, 1646123043, 1646123343, 1646123643,
1646123948, 1646124246, 1646124555, 1646124846, 1646125144,
1646125450, 1646125749, 1646126047, 1646126355), tzone = "", class = c("POSIXct",
"POSIXt"))), row.names = c(NA, -30L), class = c("tbl_df",
"tbl", "data.frame"))