Learn R Programming

move (version 2.1.0)

move: Create a Move object

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

# S4 method for connection,missing,missing,missing,missing
move(x, removeDuplicatedTimestamps=F, ...)
# S4 method for 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

Examples

Run this code
# NOT RUN {
## 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")
# }

Run the code above in your browser using DataLab