-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathREADME.Rmd
91 lines (61 loc) · 2.4 KB
/
README.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
---
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.