move: Create a Move object

Description Usage Arguments Details Note Author(s) Examples

Description

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.

Usage

1
2
3
4
## S4 method for signature 'connection,missing,missing,missing,missing'
move(x, removeDuplicatedTimestamps=F, ...)
## S4 method for signature 'numeric,numeric,POSIXct,data.frame,CRS'
move(x, y, time, data, proj, sensor='unknown',animal='unnamed',...)

Arguments

x

Full path to the file location, OR a vector with x coordinates if non-Movebank data are provided (e.g. data$x). Alternatively if no move other arguments are provided an ltraj object

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. as.POSIXct(data$timestamp, format="%Y-%m-%d %H:%M:%S", tz="UTC")

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 CRS-class) object, like CRS("+proj=longlat +ellps=WGS84"); default is NA

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

Details

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

Note

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').

Author(s)

Marco Smolla \& Bart Kranstauber

Examples

 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")

move documentation built on Jan. 16, 2017, 2:22 a.m.