read.DeponsTrack {DEPONS2R} | R Documentation |
Reading DEPONS track files
Description
Function for reading movement tracks produced by DEPONS. These describe movements of simulated animals within the simulation landscape, where the positions after each 30-min time step are provided using the coordinate reference system that were used for generating these landscapes.See van Beest et al. (2018) and Nabe-Nielsen et al. (2013) for details regarding how these files were generated as a balance between correlated random walk behaviour and spatial memory behaviour, which allows animals to return to previously visited food patches.
Usage
read.DeponsTrack(
fname,
title = "NA",
landscape = "NA",
simtime = "NA",
crs = as.character(NA),
tz = "UTC"
)
Arguments
fname |
Name of the file (character) that contains movement data generated by DEPONS. The name includes the path to the directory if this is not the current working directory. |
title |
Optional character string giving name of simulation |
landscape |
Optional character string with the landscape used in the simulation |
simtime |
Character sting with date of simulation (format yyyy-mm-dd). If not provided this is obtained from name of input file |
crs |
Character, coordinate reference system (map projection) |
tz |
Time zone used in simulations. Defaults to UTC/GMT. #' |
Value
Returns a DeponsTrack
object with the elements title
,
simtime
, crs
, and tracks
. The date
is extracted
from input data if not provided explicitly and stored as a
POSIXlt
object. The element tracks
is a list of objects
of class SpatialPointsDataFrame, each of which corresponds to one
simulated animal (several animals can be tracked in one simulation).
Examples
data(porpoisetrack) # Load data for use in example
# Use standard DEPONS coordinate reference system / map projection:
the.crs <- "+proj=laea +lat_0=52 +lon_0=10 +x_0=4321000 +y_0=3210000
+datum=WGS84 +units=m +no_defs"
## Not run:
one.fname <- "~/Applications/DEPONS/
RandomPorpoise.2020.Jul.31.09_43_10.csv"
porpoisetrack <- read.DeponsTrack(one.fname, title="Track simulated using DEPONS 2.0",
crs=the.crs)
## End(Not run)
# Plot the first of the simulated tracks
plot(porpoisetrack)