Learn R Programming

move (version 1.0)

spTransform: Transform Move object projection method

Description

The spTransform function transforms the coordinates stored in the Move object from the default longlat coordinates to the default aeqd (Azimuthal Equi-distance) projection or a different projection.

Usage

## S3 method for class 'Move,character':
spTransform(x,CRSobj,center=FALSE)
  ## S3 method for class 'Move,missing':
spTransform(x,center=FALSE,...)

Arguments

x
a Move or a MoveStack object
CRSobj
a CRS like character that describes the projection method to which the coordinates should be transformed, if missing "+proj=aequd" is used as default value
center
logical, if TRUE the center of the coordinate system is the center of the track; FALSE is default
...
for additional arguments

Details

The spTransform function transforms the coordinates of a Move object by default from "+proj=longlat" to "+proj=aeqd". In this format the coordinates can be used by the brownian.bridge.dyn function. If center is TRUE the center of the coordinate system is set to the center of the track.

Examples

Run this code
## create a Move object
leroy <- move(system.file("extdata","leroy.csv.gz",package="move"))

## transform the Move object by default into "+aeqd" projection method 
## and center the coordinate system
spTransform(leroy, center=TRUE)

## transform the Move object into another projection method, like mollweide
spTransform(leroy, CRSobj="+proj=moll")

##check projection method
proj4string(leroy)
spTransform(leroy, CRSobj=CRS("+proj=moll"))
load(system.file("extdata", "move.RData", package="move"), .GlobalEnv)
stack <- moveStack(list(leroy,leroy))
spTransform(stack)

Run the code above in your browser using DataLab