fetch_ats_positions | R Documentation |
Retrieves GPS data optionally filtered by date, last n positions, or collar
fetch_ats_positions(
device_id = NULL,
start = NULL,
end = NULL,
n = NULL,
new = FALSE,
chunk_size = 50L
)
device_id |
A single device id, or a list or vector of device ids,
or NULL for all devices associated with current account. Overrides
the new parameter when specified. If the device ids returned by
|
start , end |
Currently ignored (see Notes). |
n |
A single integer specifying how many fixes to return per collar (sorted by recency). Valid values are 5 and 10. |
new |
Currently ignored due to changes in the ATS website. |
chunk_size |
A single integer (default = 50) specifying how many collars are downloaded per HTTP request. In some rare cases entire batches may fail (with a warning) due to a few problematic collars, in which case you should set chunk_size to 1 to ensure that all available data is retrieved. |
A tibble with 25 columns:
ATS Collar ID (character)
,
Two digit year (integer)
,
Julian day (1:366, integer)
,
Hour (integer)
,
Minute (integer)
,
Activity sensor reading (integer)
,
Ambient temperature (Celsius, integer)
,
Latitude (decimal degrees, numeric)
,
Longitude (decimal degrees, numeric)
,
Horizontal Dilution of Precision (numeric)
,
Number of GPS satellites (integer)
,
GPS Fix Time (integer)
,
GPS fix dimension (integer)
,
Timestamp from raw data with fixed offset applied (POSIXct)
,
Offset from GMT in hours, mutliplied by negative one to correct for non-standard ATS usage (numeric)
,
Timestamp in UTC/GMT (POSIXct)
,
Timestamp in current system time zone (POSIXct)
,
VIT temperature (Celsius, integer)
,
VIT light sensor reading (integer) (integer)
,
VIT communication count (integer)
,
Fawn slot 0 communication count (integer)
,
Fawn slot 1 communication count (integer)
,
Fawn slot 2 communication count (numeric)
,
Transmission timestamp in UTC/GMT (POSIXct)
,
Transmission timestamp in current system time zone (POSIXct)
Currently filtering by date is broken on the ATS site - using the date range filters when downloading data returns an internal server error. The functionality is included here in the hopes that it will be fixed in the near future, but currently date filters are ignored.
ats_login
for logging into an ATS account,
fetch_ats_config
for downloading collar configurations,
fetch_ats_transmissions
for downloading transmission
data, fetch_ats_events
for downloading alerts, and
link{fetch_ats_devices}
for downloading a list of available
collars
## Not run:
ats_login("mary", ".")
# get undownloaded fixes for all collars in this account
fixes <- fetch_ats_positions(new = TRUE)
# get all fixes for all collars in this account
fixes <- fetch_ats_positions()
# get all fixes for specific collars
collar_list <- sample(fetch_ats_devices(), 10)
fixes <- fetch_ats_positions(collar_list)
# get all fixes for collars in mortality
collar_list <- fetch_ats_devices("mortality")
fixes <- fetch_ats_positions(device_id = collar_list)
# get last 10 fixes for certain collars
fixes <- fetch_ats_positions(device_id = collar_list, n = 10)
# get fixes in 2019 for all collars
fixes <- fetch_ats_positions(
start = as.POSIXct("2019-01-01"),
end = as.POSIXct("2020-01-01")
)
# get fixes in 2019 for certain collars
fixes <- fetch_ats_positions(
device_id = collar_list,
start = as.POSIXct("2019-01-01"),
end = as.POSIXct("2020-01-01")
)
# get fixes for a single collar
fixes <- fetch_ats_positions("044286")
# set chunk_size to 1 to ensure you get all available data
# if you're experiencing issues, but the download will
# take much longer to complete.
fixes <- fetch_ats_positions(chunk_size = 1)
ats_logout()
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.