https://github.com/robitalec/prepare-locs
:hammer_and_wrench: A targets workflow for processing animal relocation data for the WEEL.
https://github.com/robitalec/prepare-locs
animal animal-movement gps r targets
Last synced: about 2 months ago
JSON representation
:hammer_and_wrench: A targets workflow for processing animal relocation data for the WEEL.
- Host: GitHub
- URL: https://github.com/robitalec/prepare-locs
- Owner: robitalec
- License: gpl-3.0
- Created: 2021-09-01T15:50:47.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2024-09-24T14:30:23.000Z (about 1 year ago)
- Last Synced: 2025-04-02T14:08:35.583Z (6 months ago)
- Topics: animal, animal-movement, gps, r, targets
- Language: R
- Homepage:
- Size: 533 KB
- Stars: 0
- Watchers: 1
- Forks: 1
- Open Issues: 2
-
Metadata Files:
- Readme: README.Rmd
- Changelog: NEWS.md
- License: LICENSE
Awesome Lists containing this project
README
---
title: prepare-locs
output:
github_document:
toc: true
------
A `targets` workflow for processing animal relocation data for the WEEL.
```{r}
library(targets)
``````{r, include = FALSE}
library(printr)
library(data.table)
```# Input
Note: this workflow only processes files if it finds them at the specified path in metadata. This means you can add a row describing your own input data to `metadata()`
and use the workflow, without needing all other datasets present on your computer.```{r}
tar_read(meta)
```# Output
All outputs can be directly read with `data.table::fread` and the
datetime column will be automatically converted to POSIXct in UTC timezone.## Files
```{r}
tar_read(exports)
```## Column names
| Column name | Description |
| ----------- | ----------- |
| id | unique animal identifier |
| datetime | date time in UTC |
| doy | day of year, integer. see `data.table::yday()` |
| mnth | month, integer. see `data.table::month()` |
| yr | year, integer. see `data.table::year()` |
| x_long | longitude, EPSG code provided in `metadata()`. see `R/metadata.R` |
| y_lat | latitude, EPSG code provided in `metadata()`. see `R/metadata.R` |
| x_proj | projected x coordinate, output EPSG code in `metadata()`. see `R/metadata.R` |
| y_proj | projected y coordinate, output EPSG code in `metadata()`. see `R/metadata.R` |
| epsg_proj | output EPSG of 'x_proj' and 'y_proj' as set in `metadata()`. |
| [extracols] | Extras specified in `metadata()`. Eg. HERD. On output, column names are transformed to snake_case (eg. from 'HERD' to 'herd' or 'COLLAR ID' to 'collar_id')In target "checkflags", the column named "flag" is a semi-colon separated list of flags indicating why locs are dropped and set to NaN. After target "filters", locs with NaN are dropped.
## Flag counts
```{r, 1}
tar_read(checkflags)[order(name, -N)]
```# TODO
* 6030 not recognized by PROJ because it's not a complete CRS..
# Etc
Screening GPS fixes:* https://ropensci.github.io/CoordinateCleaner/articles/Comparison_other_software.html
+ missing coordinates
+ lat == 0
+ long == 0
+ lat == long
+ ...* *Effects of habitat on GPS collar performance: using data screening to reduce location error*. Lewis et al. 2007
+ drop 2D fixes
+ threshold PDOP
* *Screening GPS telemetry data for locations having unacceptable error*. Laver et al.