reducing mistakes when using move objects
I think we could improve the user-friendliness of the move object, by reducing the chances of using the information from the wrong slot. The thing is that yes, timestamps and coordinates have their own slots, and these are the ones that should be used, but for people that are starting to use the move object, the fact that you can also get timestamp and coordinates information in @data
, is confusing. Many people automatically use mymoveobject$
and if they than find a timestamp or coordinates, that is what they'll use. So if possible I think it would be good to remove the columns used to create slots from the @data
. Anyway it's duplicated information. Additionally I found inconsistencies between the move objects depending how they were created.
A move object created with getMovebankData
or from scratch, contain the columums timestamp, location_long, location_lat in @data
library(move)
login<-movebankLogin()
from_mb <- getMovebankData(study="BCI Ocelot", login=login)
str(from_mb@data) ## timestamp, location_long, location_lat
file <- read.table(filePath, header=TRUE, sep=",", dec=".")
from_file <- move(x=file$location.long, y=file$location.lat,
time=as.POSIXct(file$timestamp, format="%Y-%m-%d %H:%M:%S", tz="UTC"),
data=file, proj=CRS("+proj=longlat +ellps=WGS84"),
animal="Leroy", sensor="GPS")
str(from_file@data) ## timestamp, location_long, location_lat
A move object created by stating the path, only contains the timestamp column in @data
filePath<-system.file("extdata","leroy.csv.gz",package="move")
from_path <- move(filePath)
str(from_path@data) ## timestamp
I think this would be a nice improvement, although I have no idea how easy it is to implement