Learn R Programming

move (version 4.2.5)

moveStack: Creating a MoveStack

Description

Stacks a list of Move objects

Usage

# S4 method for list
moveStack(x, forceTz=NULL, ...)
  
  # S4 method for Move
moveStack(x, ..., forceTz=NULL)
  
  # S4 method for MoveStack
moveStack(x, ..., forceTz=NULL)

Value

a 'MoveStack' object

Arguments

x

a list of move or moveStack objects (or a combination of both). Timestamps of all objects have to be in the same time zone.

forceTz

The time zone, as a character, that the resulting moveStack object should have (see OlsonNames() for available time zones). If NULL the timestamps of the resulting moveStack will be in the time zone of the computer (see Sys.timezone())

...

Additional move or moveStack objects.

Author

Marco Smolla, Bart Kranstauber & Anne Scharf

Details

This function stacks single Move or Movestacks objects to a MoveStack object.

See Also

Examples

Run this code
data(leroy)
ricky<-move(system.file("extdata","ricky.csv.gz", package="move"))
leroy<-spTransform(leroy, crs(ricky))

## creating a moveStack from a list of move objects
l <- list(ricky[200:270,], leroy[200:270,])
moveStack(l)

## creating a moveStack from several move objects
moveStack(ricky[200:270,], leroy[200:270,], forceTz="UTC")

## creating a moveStack with the same time zone as input move objects
moveStack(ricky[200:270,], leroy[200:270,], forceTz=attr(timestamps(ricky),"tzone"))

# \dontshow{
data <- read.csv(system.file("extdata","leroy.csv.gz",package="move"))[100:199,]
ricky2 <- move(x=data$location.long, y=data$location.lat, time=as.POSIXct(data$timestamp,format="%Y-%m-%d %H:%M:%OS", tz="UTC"), proj=CRS("+proj=longlat +ellps=WGS84 +datum=WGS84"), data=data, animal=paste0(data$individual.local.identifier,"a"), sensor=data$sensor)
leroy<-spTransform(leroy, crs(ricky2))
list <- list(leroy, ricky2)
stack <- moveStack(list)
# }

Run the code above in your browser using DataLab