Imports multi-sensor logger data from a folder (pathname
) and optionally crop at specific date.
The *_file
arguments are matched using a regex expression (e.g., "*.pressure"
matches any
files with the extension pressure
).
Usage
pam_read(
pathname,
pressure_file = "*.pressure",
light_file = "*.glf",
acceleration_file = "*.acceleration",
crop_start = "1900-01-01",
crop_end = "2100-01-01",
id = NA
)
Arguments
- pathname
path of the directory where the files are stored
- pressure_file
file with pressure data. Extension must be
.pressure
,.deg
.- light_file
file with light data. Extension must be
.glf
,.lux
orNA
if absent.- acceleration_file
file with acceleration data. Extension must be
.acceleration
,.deg
orNA
if absent.- crop_start
Remove all date before this date (in UTC).
- crop_end
Remove all date after this date (in UTC).
- id
Unique identifier of the track. Default (
NA
) is to take the part ofpressure_file
up to a character_
(e.g.18LX
for18LX_20180725.pressure
). Ifbasename
, take the basename ofpressure_file
.
Details
The current implementation can read the files from:
Swiss Ornithological Institute (SOI) (default) with
pressure_file = "*.pressure"
,light_file = "*.glf"
andacceleration_file = "*.acceleration"
Migrate Technology with
pressure_file = "*.deg"
,light_file = "*.lux"
andacceleration_file = "*.deg"
Create an issue on github if you have data in a format not supported yet.
Examples
pam <- pam_read(
pathname = system.file("extdata/0_PAM/18LX", package = "GeoPressureR")
)
summary(pam)
#> Length Class Mode
#> pressure 2 data.frame list
#> light 2 data.frame list
#> acceleration 2 data.frame list
#> id 1 -none- character
head(pam$id)
#> [1] "18LX"
head(pam$pressure)
#> date obs
#> 1 2017-07-27 00:00:00 989
#> 2 2017-07-27 00:30:00 989
#> 3 2017-07-27 01:00:00 990
#> 4 2017-07-27 01:30:00 990
#> 5 2017-07-27 02:00:00 989
#> 6 2017-07-27 02:30:00 989
head(pam$light)
#> date obs
#> 1 2017-07-27 00:00:00 0
#> 2 2017-07-27 00:05:00 0
#> 3 2017-07-27 00:10:00 0
#> 4 2017-07-27 00:15:00 0
#> 5 2017-07-27 00:20:00 0
#> 6 2017-07-27 00:25:00 0
head(pam$acceleration)
#> date obs
#> 1 2017-07-27 00:00:00 0
#> 2 2017-07-27 00:05:00 0
#> 3 2017-07-27 00:10:00 0
#> 4 2017-07-27 00:15:00 0
#> 5 2017-07-27 00:20:00 0
#> 6 2017-07-27 00:25:00 0