Title: | Prepares Relocations For The WEEL |
---|---|
Description: | Prepares animal relocation datasets for the Wildlife Evolutionary Ecology Lab at Memorial University. |
Authors: | Alec L. Robitaille [aut, cre] |
Maintainer: | Alec L. Robitaille <[email protected]> |
License: | GPL-3 |
Version: | 0.1.3 |
Built: | 2024-11-21 04:05:33 UTC |
Source: | https://github.com/robitalec/prepare-locs |
check col
check_col(DT = NULL, col = NULL, arg = NULL, extra = NULL)
check_col(DT = NULL, col = NULL, arg = NULL, extra = NULL)
DT |
data.table |
col |
column name |
arg |
argument name |
extra |
extras |
Check deployment
check_deployment(DT, meta)
check_deployment(DT, meta)
meta |
metadata with variable 'deployment' indicating path to csv with three columns indicating 'id' animal id, 'start_date' start of deployment and 'end_date' end of deployment both structured as 'YYYY-MM-DD' formatted character |
using functions check_longlat and check_loc_meta
check_locs(DT, meta)
check_locs(DT, meta)
meta |
Alec L. Robitaille
Check location data's meta information eg. map quality, DOP, manual exclusion
check_locs_meta(DT)
check_locs_meta(DT)
DT |
data.table |
data.table
Alec L. Robitaille
Check long and lat
check_longlat(DT)
check_longlat(DT)
DT |
data.table |
data.table
Alec L. Robitaille
Checks for duplicate names and filters if file doesn't exist on the current machine
check_meta(meta)
check_meta(meta)
Alec L. Robitaille
check type
check_type(DT = NULL, col = NULL, type = NULL)
check_type(DT = NULL, col = NULL, type = NULL)
DT |
data.table. |
col |
column name. |
type |
typeof type type typeof type. |
Minimal wrapper around fwrite, to write separate CSVs if splitBy is provided
export_csv(DT, outpath, splitBy, extracols)
export_csv(DT, outpath, splitBy, extracols)
splitBy |
Alec L. Robitaille
Metadata about input data including file paths, column names, time zones and EPSG codes.
metadata()
metadata()
path |
filepath |
x_long |
unprojected longitude coordinate column name |
y_lat |
unprojected latitude coordinate column name |
id |
individual identifier column name |
datetime |
datetime column name. either provide datetime or both date and time |
date |
date column name. either provide both date and time or datetime |
time |
time column name. either provide both date and time or datetime |
extracols |
list of extra column names to preserve |
tz |
time zone of datetime columns as stored in the input file |
epsgin |
EPSG code of input. if numeric, EPSG code to use for all rows. if character, column name of EPSG code in DT |
epsgout |
local projection EPSG code to reproject x_long+y_lat into |
deployment |
path to deployment CSV. see |
Alec L. Robitaille
overwite_col
overwrite_col(DT = NULL, col = NULL)
overwrite_col(DT = NULL, col = NULL)
DT |
data.table |
col |
column name |
Prepare datetime column
prep_dates(DT, tz)
prep_dates(DT, tz)
tz |
character; time zone of the data input, as it is stored the file. |
data.table with datetime in UTC time, idate, itime and DOY
Alec L. Robitaille
Project locs
project_locs(DT, epsgin, epsgout)
project_locs(DT, epsgin, epsgout)
EPSG |
numeric; EPSG code |
Alec L. Robitaille
Read data
read_data(path, meta)
read_data(path, meta)
path |
character; path to input file passed to fread |
data.table
Alec L. Robitaille
Set consistent column names
set_colnames( DT, x_long, y_lat, id, date = NULL, time = NULL, datetime = NULL, extracols = NULL )
set_colnames( DT, x_long, y_lat, id, date = NULL, time = NULL, datetime = NULL, extracols = NULL )
extracols |
character vector; list of column names to include (eg. for group_pts splitBy) |
Input DT with only selected columns id, datetime, coords and any column provided in extracols
Alec L. Robitaille
Appends flag to existing flag(s)
why(flag, why)
why(flag, why)
why |