Transforming a move or moveStack into a data.frame gives different results
There are different ways of back transforming a move or moveStack into a data.frame, and they give different results. My point here is that maybe it would be more useful to have the as(...,"data.frame") function listed in the package, rather than the as.data.frame
library(move)
data(leroy)
data(ricky)
mvstk <- moveStack(list(leroy, ricky))
This is the function listed in the package, but only returns part of the data
names(as.data.frame(leroy))
# [1] "timestamp" "location.long"
# [3] "location.lat" "eobs.battery.voltage"
# [5] "eobs.horizontal.accuracy.estimate" "eobs.key.bin.checksum"
# [7] "eobs.speed.accuracy.estimate" "eobs.start.timestamp"
# [9] "eobs.status" "eobs.temperature"
# [11] "eobs.type.of.fix" "eobs.used.time.to.get.fix"
# [13] "ground.speed" "heading"
# [15] "height.above.ellipsoid" "utm.easting"
# [17] "utm.northing" "utm.zone"
# [19] "study.local.timestamp"
The only difference to as.data.frame is that there is a added column "optional", wich I have no clue what it refers to
names(data.frame(leroy))
# [1] "timestamp" "location.long"
# [3] "location.lat" "eobs.battery.voltage"
# [5] "eobs.horizontal.accuracy.estimate" "eobs.key.bin.checksum"
# [7] "eobs.speed.accuracy.estimate" "eobs.start.timestamp"
# [9] "eobs.status" "eobs.temperature"
# [11] "eobs.type.of.fix" "eobs.used.time.to.get.fix"
# [13] "ground.speed" "heading"
# [15] "height.above.ellipsoid" "utm.easting"
# [17] "utm.northing" "utm.zone"
# [19] "study.local.timestamp" "optional"
Is actually returning all the data as the one obtained from movebank
names(as(leroy,"data.frame"))
# [1] "timestamp" "location.long"
# [3] "location.lat" "eobs.battery.voltage"
# [5] "eobs.horizontal.accuracy.estimate" "eobs.key.bin.checksum"
# [7] "eobs.speed.accuracy.estimate" "eobs.start.timestamp"
# [9] "eobs.status" "eobs.temperature"
# [11] "eobs.type.of.fix" "eobs.used.time.to.get.fix"
# [13] "ground.speed" "heading"
# [15] "height.above.ellipsoid" "utm.easting"
# [17] "utm.northing" "utm.zone"
# [19] "study.local.timestamp" "optional"
# [21] "sensor" "timestamps"
# [23] "eobs.fix.battery.voltage" "manually.marked.outlier"
# [25] "visible" "sensor.type"
# [27] "individual.taxon.canonical.name" "tag.local.identifier"
# [29] "individual.local.identifier" "study.name"
# [31] "study.timezone"
In the case of a moveStak, using the as.data.frame function, does not include the "individual.local.identifier" or "trackId" so it is not possible to distinguish the individuals
names(as.data.frame(mvstk))
# [1] "timestamp" "eobs.battery.voltage"
# [3] "eobs.horizontal.accuracy.estimate" "eobs.key.bin.checksum"
# [5] "eobs.speed.accuracy.estimate" "eobs.start.timestamp"
# [7] "eobs.status" "eobs.temperature"
# [9] "eobs.type.of.fix" "eobs.used.time.to.get.fix"
# [11] "ground.speed" "heading"
# [13] "height.above.ellipsoid" "utm.easting"
# [15] "utm.northing" "utm.zone"
# [17] "study.local.timestamp" "X"
# [19] "event.id" "eobs.fix.battery.voltage"
# [21] "location.long" "location.lat"
Using the as(...,"data.frame") returns a useful data frame
names(as(mvstk,"data.frame"))
# [1] "timestamp" "eobs.battery.voltage"
# [3] "eobs.horizontal.accuracy.estimate" "eobs.key.bin.checksum"
# [5] "eobs.speed.accuracy.estimate" "eobs.start.timestamp"
# [7] "eobs.status" "eobs.temperature"
# [9] "eobs.type.of.fix" "eobs.used.time.to.get.fix"
# [11] "ground.speed" "heading"
# [13] "height.above.ellipsoid" "utm.easting"
# [15] "utm.northing" "utm.zone"
# [17] "study.local.timestamp" "X"
# [19] "event.id" "eobs.fix.battery.voltage"
# [21] "location.long" "location.lat"
# [23] "optional" "sensor"
# [25] "timestamps" "trackId"
# [27] "eobs.fix.battery.voltage.1" "manually.marked.outlier"
# [29] "visible" "sensor.type"
# [31] "individual.taxon.canonical.name" "tag.local.identifier"
# [33] "individual.local.identifier" "study.name"
# [35] "study.timezone" "behavioural.classification"