使用包 move 插值数据:如何创建 movestack 对象?

Interpolating data using the package move: How to create a movestack object?

我刚开始在我的硕士论文项目中使用 R,我正在尝试使用包移动为我的企鹅跟踪数据插入采样率。但是,当尝试创建 movestack 对象时,出现此错误:

Error in validityMethod(as(object, superClass)) : 
  There are NA timestamps records

和这条警告消息

In addition: Warning messages:
1: In showSRID(uprojargs, format = "PROJ", multiline = "NO", prefer_proj = prefer_proj) :
  Discarded ellps WGS 84 in Proj4 definition: +proj=merc +a=6378137 +b=6378137 +lat_ts=0 +lon_0=0 +x_0=0 +y_0=0 +k=1 +units=m +nadgrids=@null +wktext +no_defs
2: In showSRID(uprojargs, format = "PROJ", multiline = "NO", prefer_proj = prefer_proj) :
  Discarded datum WGS_1984 in Proj4 definition

代码:

alltripsfiltered <- read.csv(file = "C:/Users/Admin/OneDrive - Massey University/Documents/Korora/GPS data for all trips/alltracksfiltered00.csv")

tracks.move<- move(x=alltripsfiltered$Long, y=alltripsfiltered$Lat, time =as.POSIXct(alltripsfiltered$datetime, format="%Y-%m-%d %H:%M:%OS", tz="UTC"), proj=CRS("+init=epsg:3857"), animal=alltripsfiltered$TripID)

和数据:

dput(alltripsfiltered[1:6, ])
structure(list(X = 1:6, Deployment = c(1L, 1L, 1L, 1L, 1L, 1L
), Device = c(2L, 2L, 2L, 2L, 2L, 2L), Box.no. = c("C23", "C23", 
"C23", "C23", "C23", "C23"), Bird.no. = c(10825325L, 10825325L, 
10825325L, 10825325L, 10825325L, 10825325L), Breeding.Stage = c(1L, 
1L, 1L, 1L, 1L, 1L), Long = c(174.78327, 174.78326, 174.78332, 
174.78323, 174.78325, 174.78277), Lat = c(-41.09482, -41.09491, 
-41.09484, -41.09491, -41.09496, -41.09564), datetime = c("18/09/2020 4:13", 
"18/09/2020 4:14", "18/09/2020 4:15", "18/09/2020 4:16", "18/09/2020 4:17", 
"18/09/2020 4:18"), TripID = c(1L, 1L, 1L, 1L, 1L, 1L), Trip.no. = c(1L, 
1L, 1L, 1L, 1L, 1L), Complete = c(0L, 0L, 0L, 0L, 0L, 0L), optional = c(TRUE, 
TRUE, TRUE, TRUE, TRUE, TRUE)), row.names = c(NA, 6L), class = "data.frame")

我不确定发生这种情况是因为 R 中的问题还是我的数据集。我打算 运行 代码的其余部分使用“movestack”对象然后分成单独的行程,这样我就可以提取用于计算家庭范围的值:

tracks.split<- split(tracks.move)
##interpolate the first track
track1interpolated<-interpolateTime(tracks.split$X1, time=as.difftime(1, units="mins"), spaceMethod=c('greatcircle'))
track1interpolated
##continue to do this for all tracks (change to X2, X3….), 

您输入的日期时间格式与您在时间参数中输入的格式不同:

tracks.move<- move(x=alltripsfiltered$Long, y=alltripsfiltered$Lat, time =as.POSIXct(alltripsfiltered$datetime, format="%d/%m/%Y %H:%M", tz="UTC"), 
                   proj=CRS("+init=epsg:3857"), animal=alltripsfiltered$TripID)