You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi all,
I'm also working with my own dataset (in LongLat format) and I'm getting an error message when trying to align my movement data with align_move(). My code is as following:
R.move<-move(as.numeric(R.ready$Longitude.decimal),as.numeric(R.ready$Latitude.decimal),
time = R.ready$Timestamp.1,
proj="+init=epsg:4326 +proj=longlat +datum=WGS84 +no_defs +ellps=WGS84 +towgs84=0,0,0")
unique(timestamps(R.move))
timeLag(R.move,unit="mins")
m<-align_move(R.move, res = 1200, unit = "mins")
When I run this i get the following Error message:
Error in .pointsToMatrix(p1) : latitude > 90
In addition: Warning message:
In .pointsToMatrix(p1) : longitude > 180
Cannot figure out what is wrong here. Hope you can help me. See the data attached.
Many thanks in advance!
Matteo Move_sample.txt
The text was updated successfully, but these errors were encountered:
I could not reproduce the error but my guess is the column names of your data.frame R.ready were shifted, since " " is used as separator in Move_sample.txt, but " " is also contained in Timestamp1. When simply using read.csv or read.table with sep = " " to load your file, the number of column names and the number of columns differ and thus column names point to the wrong columns shifted by 1.
I based my guess on the fact that the following example works for your sample dataset and align_move does not throw an error here.
# read csv without header and row.names since no row.names contained# sep = " " will split the last field (Timestamp.1) into two, thus the header would not matchdf<- read.csv("Move_sample.txt", sep="", header=F, row.names=NULL,
stringsAsFactors=F)
df<-df[-1,] # remove header row# create data frame with lat, lon and timestamps from merging column 18 and 19df<-data.frame(lat= as.numeric(df[,14]),
lon= as.numeric(df[,15]),
time= as.POSIXct(paste0(df[,18], "", df[,19]), tz="UTC"))
# remove rows with NA locationsdf<-df[apply(df, MARGIN=1, function(x) !any(is.na(x))),]
# create move object from df (you could also use move() for this)m.df<- df2move(df, proj="+init=epsg:4326 +proj=longlat +datum=WGS84 +no_defs +ellps=WGS84 +towgs84=0,0,0",
x="lat", y="lon", time="time")
# align movementm.aligned<- align_move(m.df, res=1200, unit="mins")
Hi all,
I'm also working with my own dataset (in LongLat format) and I'm getting an error message when trying to align my movement data with align_move(). My code is as following:
R.move<-move(as.numeric(R.ready$Longitude.decimal),as.numeric(R.ready$Latitude.decimal),
time = R.ready$Timestamp.1,
proj="+init=epsg:4326 +proj=longlat +datum=WGS84 +no_defs +ellps=WGS84 +towgs84=0,0,0")
unique(timestamps(R.move))
timeLag(R.move,unit="mins")
m<-align_move(R.move, res = 1200, unit = "mins")
When I run this i get the following Error message:
Error in .pointsToMatrix(p1) : latitude > 90
In addition: Warning message:
In .pointsToMatrix(p1) : longitude > 180
Cannot figure out what is wrong here. Hope you can help me. See the data attached.
Many thanks in advance!
Matteo
Move_sample.txt
The text was updated successfully, but these errors were encountered: