Description Usage Arguments Details Note Author(s) Examples
The move method creates Move or MoveStack object from Movebank or other (compressed) csv files, also zip files from the environmental annotation tool can be loaded. If you use your own data you need to set the projection method with the 'proj' argument and specify in which column of your data the function finds locations and timestamps.
1 2 3 4 |
x |
Full path to the file location, OR a vector with x coordinates if non-Movebank data are provided (e.g. |
y |
vector of y coordinates if non-Movebank data are provided |
time |
column indicator for non-Movebank data for the time stamps, with POSIXct conversion, i.e. |
data |
Optional extra data associated with the relocation, if empty it is filled with the coordinates and timestamps |
proj |
projection method for non-Movebank data; requires a valid CRS (see |
sensor |
sensor name, either single character or a vector with length of the number of coordinates |
animal |
animal ID or name, either single character or a vector with length of the number of coordinates |
removeDuplicatedTimestamps |
It his possible to add the argument removeDuplicatedTimestamps and set it to true which allows you delete the duplicated timestamps, it is strongly advised not to use this option because there is no control over which records are removed. Its better to edit the records in movebank. |
... |
Additional arguments |
The easiest way to import data is to download the study you are interested in from www.movebank.org. Set the file path as the x argument of the move function. The function detects whether there are single or multiple individuals in this file and automatically creates either a Move or MoveStack object.
Another way is to read in your data using read.csv
. Then the columns with the x and y coordinates, and the timestamp, as well as the whole data.frame of the imported data are given to the move
function. Again the function detects whether to return a Move or a MoveStack object
The imported data set is checked whether it is in a Movebank format. If this is not the case, you have to use the alternative import for non-Movebank data (see above).
Because the SpatialPointsDataFrame function that creates the spatial data frame of the Move
object can not process NA location values, all rows with NA locations are stored as unused records.
If the data include double timestamps check your data for validity. You may want to consider a function to delete double timestamps, like: data <- data[which(!duplicated(data$timestamp)), ]
or use the removeDuplicatedTimestamps argument but this does no attempt to retain the most likely location.
Due to convention all names are turned into 'good names' which means, without spaces ('Ricky T' becomes 'Ricky.T').
Marco Smolla \& Bart Kranstauber
1 2 3 4 5 6 7 8 9 10 11 | ## create a move object from a Movebank csv file
filePath<-system.file("extdata","leroy.csv.gz",package="move")
data <- move(filePath)
## create a move object from non-Movebank data
file <- read.table(filePath,
header=TRUE, sep=",", dec=".")
data <- 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")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.