tag_create | R Documentation |
tag
objectCreate a GeoPressureR tag
object from the data collected by a tracking device. The function
can read data formatted according to three manufacturers SOI, Migratetech or Lund CAnMove, as
well as according to the GeoLocator Data package standard and also accept manual data.frame as
input. Pressure data is required for the GeoPressureR workflow but can be allowed to be missing
with assert_pressure = FALSE
.
tag_create(
id,
manufacturer = NULL,
crop_start = NULL,
crop_end = NULL,
directory = glue::glue("./data/raw-tag/{id}"),
pressure_file = NULL,
light_file = NULL,
acceleration_file = NULL,
temperature_external_file = NULL,
temperature_internal_file = NULL,
magnetic_file = NULL,
assert_pressure = TRUE,
quiet = FALSE
)
id |
unique identifier of a tag. |
manufacturer |
One of |
crop_start |
remove all data before this date (POSIXct or character in UTC). |
crop_end |
remove all data after this date (POSIXct or character in UTC). |
directory |
path of the directory where the tag files can be read. |
pressure_file |
name of the file with pressure data. Full pathname or finishing
with extensions (e.g., |
light_file |
name of the file with light data. Full pathname or finishing
with extensions (e.g., |
acceleration_file |
name of the file with acceleration data. Full pathname or finishing
with extensions (e.g., |
temperature_external_file |
name of the file with temperature data. Full pathname or
finishing with extensions (e.g., |
temperature_internal_file |
name of the file with temperature data . Full pathname or
finishing with extensions (e.g., |
magnetic_file |
name of the file with magnetic/accelerometer data. Full pathname or
finishing with extensions (e.g., |
assert_pressure |
logical to check that the return tag has pressure data. |
quiet |
logical to hide messages about the progress. |
The current implementation can read files from the following three sources:
GeoLocator Data Package (gldp
)
pressure_file = "pressure.csv"
(optional)
light_file = "light.csv"
(optional)
acceleration_file = "acceleration.csv"
(optional)
temperature_external_file = "temperature.csv"
(optional)
temperature_external_file = "airtemperature.csv"
(optional)
magnetic_file = "magnetic.csv"
(optional)
Swiss Ornithological Institute (soi
)
pressure_file = "*.pressure"
light_file = "*.glf"
(optional)
acceleration_file = "*.acceleration"
(optional)
temperature = "*.temperature"
(optional)
airtemperature = "*.airtemperature"
(optional)
magnetic = "*.magnetic"
(optional)
Migrate Technology (migratetech
):
pressure_file = "*.deg"
light_file = "*.lux"
(optional)
acceleration_file = "*.deg"
(optional)
British Antarctic Survey (bas
), aquired by Biotrack Ltd in 2011, renamed Lotek in 2019 . Only works for light data (assert_pressure = FALSE
)
light_file = "*.lig"
pressure_file = "*_press.xlsx"
light_file = "*_acc.xlsx"
(optional)
acceleration_file = "*_acc.xlsx"
(optional)
pressure_file = "*.txt"
You can also enter the data manually (manufacturer = "manual"
) by providing the data.frame to
pressure_file
:
pressure_file
: data.frame with column date and value.
light_file
: (optional) data.frame with column date and value.
acceleration_file
: (optional) data.frame with column date and value.
You can still create a tag
without pressure data using assert_pressure = TRUE
. This tag
won't be able to run the traditional GeoPressureR workflow, but you can still do some analysis.
By default manufacturer = NULL
, the manufacturer is determined automatically from the content
of the directory
. You can also specify manually the file with a full pathname or the file
extension using a regex expression (e.g., "*.pressure"
matches any file ending with
pressure
).
Please create an issue on Github if you have data in a format that is not yet supported.
This function can be used to crop the data at specific date, for instance to remove pre-equipment or post-retrieval data.
a GeoPressureR tag
object containing
param
parameter object (see param_create()
)
pressure
data.frame with columns: date
and value
light
(optional) same structure as pressure
temperature_external
(optional) same structure as pressure
temperature_internal
(optional) same structure as pressure
acceleration
(optional) data.frame with columns: date
, value
, act
and pit
.
value
is the activity computed as the sum of the difference in acceleration on the z-axis
(i.e. jiggle). In the SOI sensor, it is summarised from 32 measurements at 10Hz
pitch
is the relative position of the bird’s body relative to the z axis. In the SOI
sensor, it is an average over 32 measurements at 10Hz.
magnetic
(optional) data.frame with columns: date
, magnetic_x
, magnetic_y
, magnetic_z
, acceleration_x
, acceleration_y
and acceleration_z
Other tag:
print.tag()
,
tag_set_map()
withr::with_dir(system.file("extdata", package = "GeoPressureR"), {
# Read all sensor file
tag <- tag_create("18LX")
print(tag)
# Read only pressure and crop date
tag <- tag_create("18LX",
light_file = NULL,
acceleration_file = NULL,
crop_start = "2017-08-01",
crop_end = "2017-08-05"
)
print(tag)
# You can also specify the exact file in case multiple files with the
# same extension exist in your directory (migratetech data)
tag <- tag_create("CB621",
pressure_file = "CB621_BAR.deg",
light_file = "CB621.lux",
acceleration_file = NULL
)
print(tag)
# You can specify the data manually with
pressure <- data.frame(
date = as.POSIXct(c(
"2017-06-20 00:00:00 UTC", "2017-06-20 01:00:00 UTC",
"2017-06-20 02:00:00 UTC", "2017-06-20 03:00:00 UTC"
), tz = "UTC"),
value = c(1000, 1000, 1000, 1000)
)
tag_create(id = "xxx", pressure_file = pressure)
})
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.