Package 'preparelocs'

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

Help Index


check col

Description

check col

Usage

check_col(DT = NULL, col = NULL, arg = NULL, extra = NULL)

Arguments

DT

data.table

col

column name

arg

argument name

extra

extras


Check deployment

Description

Check deployment

Usage

check_deployment(DT, meta)

Arguments

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


Check locs

Description

using functions check_longlat and check_loc_meta

Usage

check_locs(DT, meta)

Arguments

meta

Author(s)

Alec L. Robitaille


Check loc meta

Description

Check location data's meta information eg. map quality, DOP, manual exclusion

Usage

check_locs_meta(DT)

Arguments

DT

data.table

Value

data.table

Author(s)

Alec L. Robitaille


Check long and lat

Description

Check long and lat

Usage

check_longlat(DT)

Arguments

DT

data.table

Value

data.table

Author(s)

Alec L. Robitaille


Check metadata

Description

Checks for duplicate names and filters if file doesn't exist on the current machine

Usage

check_meta(meta)

Author(s)

Alec L. Robitaille


check type

Description

check type

Usage

check_type(DT = NULL, col = NULL, type = NULL)

Arguments

DT

data.table.

col

column name.

type

typeof type type typeof type.


Export CSVs

Description

Minimal wrapper around fwrite, to write separate CSVs if splitBy is provided

Usage

export_csv(DT, outpath, splitBy, extracols)

Arguments

splitBy

Author(s)

Alec L. Robitaille


Generate data details

Description

Metadata about input data including file paths, column names, time zones and EPSG codes.

Usage

metadata()

Arguments

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 check_deployment().

Author(s)

Alec L. Robitaille


overwite_col

Description

overwite_col

Usage

overwrite_col(DT = NULL, col = NULL)

Arguments

DT

data.table

col

column name


Prepare datetime column

Description

Prepare datetime column

Usage

prep_dates(DT, tz)

Arguments

tz

character; time zone of the data input, as it is stored the file.

Value

data.table with datetime in UTC time, idate, itime and DOY

Author(s)

Alec L. Robitaille


Project locs

Description

Project locs

Usage

project_locs(DT, epsgin, epsgout)

Arguments

EPSG

numeric; EPSG code

Author(s)

Alec L. Robitaille


Read data

Description

Read data

Usage

read_data(path, meta)

Arguments

path

character; path to input file passed to fread

Value

data.table

Author(s)

Alec L. Robitaille


Set consistent column names

Description

Set consistent column names

Usage

set_colnames(
  DT,
  x_long,
  y_lat,
  id,
  date = NULL,
  time = NULL,
  datetime = NULL,
  extracols = NULL
)

Arguments

extracols

character vector; list of column names to include (eg. for group_pts splitBy)

Value

Input DT with only selected columns id, datetime, coords and any column provided in extracols

Author(s)

Alec L. Robitaille


Why flag why

Description

Appends flag to existing flag(s)

Usage

why(flag, why)

Arguments

why