format_data | R Documentation |
aniMotum
formatformat data by mapping supplied variable names to those expected by
fit_ssm()
, and ensuring variables are put into the expected order. Can be
run manually by user as a data pre-processing step prior to calling fit_ssm()
or can be called automatically by fit_ssm()
. In the latter case, any custom
variable names must be declared as arguments to fit_ssm()
; see examples, below.
format_data(
x,
id = "id",
date = "date",
lc = "lc",
coord = c("lon", "lat"),
epar = c("smaj", "smin", "eor"),
sderr = c("x.sd", "y.sd"),
tz = "UTC"
)
x |
input data |
id |
the name (as a quoted character string) of id variable: a unique identifier for individual (animal) track data sets. |
date |
the name (as a quoted character string)of the date/time variable: date and time (as YYYY-MM-DD HH:MM:SS) of each observation. |
lc |
the name (as a quoted character string) of the location quality class variable: Argos location quality class (values in the set: 3,2,1,0,"A","B","Z"). Can also include "G" for GPS data and/or "GL" for light-level geolocation (GLS) and other data types. |
coord |
the names (as quoted character strings) of the location coordinate
variables: defaults are c("lon","lat"), but could also be c("x","y") for planar
coordinates; or if input data is an |
epar |
the names (as quoted character strings) of the Argos error ellipse parameters: defaults are "smaj" (ellipse semi-major axis), "smin" (ellipse semi-minor axis), and "eor" (ellipse orientation). Ignored if these variables are missing from the input data. |
sderr |
the names (as quoted character strings) of provided standard
errors for |
tz |
the timezone the applies to the data/time variable if they are not
in |
a data.frame or sf-tibble of input data in expected aniMotum format.
Additional columns required by fit_ssm()
, if missing, will be added to the
formatted tibble: smaj
, smin
, eor
, x.sd
, and y.sd
.
## as a data pre-processing step
data(sese2_n)
head(sese2_n, 5)
d <- format_data(sese2_n, date = "time", coord = c("longitude","latitude"),
tz = "America/Halifax")
fit <- fit_ssm(d, model = "crw", time.step = 24)
## called automatically within fit_ssm()
fit <- fit_ssm(sese2_n, date = "time", coord = c("longitude", "latitude"),
tz = "America/Halifax", model = "crw", time.step = 24)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.