clean_location_data {animaltracker}R Documentation

Cleans a raw animal GPS dataset, implementing a standardized procedure to remove impossible values

Description

Cleans a raw animal GPS dataset, implementing a standardized procedure to remove impossible values

Usage

clean_location_data(
  df,
  dtype,
  prep = TRUE,
  filters = TRUE,
  aniid = NA,
  gpsid = NA,
  maxrate = 84,
  maxcourse = 100,
  maxdist = 840,
  maxtime = 60 * 60,
  tz_in = "UTC",
  tz_out = "UTC"
)

Arguments

df

data frame in standardized format (e.g., from a raw spreadsheet)

dtype

data type, iGotU or Columbus P-1

prep

reformat columns if all required columns are not present, defaults to True

filters

filter bad data points, defaults to true

aniid

identification code for the animal

gpsid

identification code for the GPS device

maxrate

maximum rate of travel (meters/minute) between consecutive points

maxcourse

maximum distance (meters) between consecutive points

maxdist

maximum geographic distance (meters) between consecutive points

maxtime

maximum time (minutes) between consecutive points

tz_in

input time zone, defaults to UTC

tz_out

output time zone, defaults to UTC

Value

data frame of clean animal GPS data

Examples

# Clean a data frame from csv

## Read igotU data
bannock_df <- read.csv(system.file("extdata", "demo_nov19/Bannock_2017_101_1149.csv", 
package = "animaltracker"), skipNul=TRUE)

## Clean and filter
clean_location_data(bannock_df, dtype = "igotu", filters = TRUE, aniid = 1149, 
gpsid = 101, maxrate = 84, maxdist = 840, maxtime = 100)

## Clean without filtering
clean_location_data(bannock_df, dtype = "igotu", filters = FALSE, aniid = 1149, 
gpsid = 101, maxrate = 84, maxdist = 840, maxtime = 100)

# Clean a data frame from txt

## Read Columbus P-1 data
columbus_df <- read_columbus(system.file("extdata", "demo_columbus.TXT", 
package = "animaltracker"))

## Clean and filter
clean_location_data(columbus_df, dtype = "columbus", filters = TRUE, aniid = 1149, 
gpsid = 101, maxrate = 84, maxdist = 840, maxtime = 100)

[Package animaltracker version 0.2.0 Index]