Free Access Week - Data Engineering + BI
Data Engineering and BI courses are free this week!
Free Access Week - Jun 2-8

Animal Tracker

Overview

This is a repository for an R package with data management and visualization tools for GPS and accelerometer data for tracking animals (e.g., cows). Includes two Shiny Apps to visualize and analyze the associated spatial-temporal data.

Please refer to the PDF manual for detailed information on function usage.

Core Features

Dynamic User Interface and Data

The Animal Tracker app ships with demo data included. Or, conveniently upload your own .csv or .txt animal data files in a zip folder. There is an option for the app to filter bad data points after files are uploaded.

By default, the elevation lookup is bounded by the maximum/minimum latitude and longitude determined from parsing the uploaded data, but the bounds can be modified manually. Similarly, the zoom level defaults to the current map zoom, but can also be changed manually to values from 1-14. Click on the checkboxes to include slope and aspect with elevation.

Use the dropdown selections to filter by site, animal, or date range. The app features will dynamically update based on your selections, and the filtered data is also available as a download.

Dynamic Map

In addition, Animal Tracker can visualize the terrain from your animal data. Toggle between point and heatmap views, or overlay both. Draw a rectangle to select a particular region.

Dynamic Plots

Animal Tracker also visualizes and compares your animals' behaviors. Plots include elevation over time by animal and number of points in the sample by animal as well as rate of travel by animal and total time spent by location (not shown).

Dynamic Statistics

The app comes with a statistical summary utility to complement the visualizations. Choose between elevation, time difference between GPS measurements, course, course difference between GPS measurements, distance, and rate to summarize. Then, select from sample size, mean, median, standard deviation, variance, minimum value, maximum value, range, interquartile range, first quartile, and third quartile statistics.

Additional Features

Validation App

Compare and visualize two datasets side-by-side with the validation app. Try the app with the included demo datasets, or upload your own .csv files (.txt is not yet supported).

Outlier detection can also be applied. We currently support modified z-score classification according to Iglewicz and Hoaglin (1993).

Furthermore, summary statistics are provided for flagged data from the app's outlier detection or a method already applied to the data before upload.

Usage

Installation in R

This app can be installed and run through RStudio (or the basic R console).

devtools

Before installing Animal Tracker, ensure that you have the devtools package installed and loaded:

install.packages("devtools") 
library(devtools)

animaltracker

Install and load animaltracker by running the following:

install_github(“mathedjoe/animaltracker”)
library(animaltracker) 

Core Shiny App

Launch the core shiny app by running the following :

run_shiny_animaltracker()

Validation Shiny App

Launch the validation shiny app by running the following:

run_validation_app()

Questions

Email joechampion@boisestate.edu.

Contributors

Copy Link

Version

Install

install.packages('animaltracker')

Monthly Downloads

59

Version

0.2.0

License

GPL-3

Maintainer

Joe Champion

Last Published

November 17th, 2020

Functions in animaltracker (0.2.0)

clean_location_data

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

'shiny' module UI output for the animaltracker app's dynamic dropdown selections.
datePickerOutput

'shiny' module UI output for the animaltracker app's date picker.
demo_unfiltered

Unfiltered demo animal GPS data from cows
reactivePicker

'shiny' module server-side UI generator for the animaltracker app's dynamic dropdown selections.
datePicker

'shiny' module server-side UI generator for the animaltracker app's date picker.
deg_to_dec

Helper function for cleaning Columbus P-1 datasets. Given lat or long coords in degrees and a direction, convert to decimal.
get_file_meta

Generate metadata for a directory of animal data files
demo_filtered_elev

Filtered demo animal GPS data from cows with elevation
demo_meta

Metadata for demo animal GPS data from cows
demo

Demo animal GPS data from cows
demo_info

Raw demo animal GPS data from cows with information
reactiveRangeOutput

'shiny' module UI output for the animaltracker app's coordinate range input.
reactiveRange

'shiny' module server-side UI generator for the animaltracker app's coordinate range input.
dev_add_to_gitignore

Add big files to a .gitignore file
lookup_elevation_file

Add elevation data from terrain tiles to long/lat coordinates of animal gps data
get_data_from_meta

Get animal data set from specified meta. If date range is invalid, automatically returns all animal data specified by meta_df.
run_validation_app

Run the 'shiny' validation app
process_elevation

Process and optionally export modeled elevation data from existing animal data file
summarise_anidf

Calculates summary statistics for an animal data frame
store_batch_list

Generates basic metadata about a directory of animal data files and stores the files as data frames as a list with the meta
histogram_animal_elevation

Generate a histogram of the distribution of modeled elevation - measured altitude
compare_summarise_daily

Compares two animal datasets and calculates daily summary statistics by GPS GPS, date, lat, long, course, distance, rate, elevation column names should match.
histogram_time

Generates a histogram to visualize the distribution of time between GPS measurements.
compare_summarise_data

Compares two animal data frames and calculates summary statistics. GPS, date, lat, long, course, distance, rate, elevation column names should match.
demo_comparison

Demo comparison of two animal datasets
qqplot_time

Generates a QQ plot to show the distribution of time between GPS measurements.
read_zip_to_rasters

Read an archive of altitude mask files and convert the first file into a raster object
quantile_time

Determines the GPS measurement time value difference values roughly corresponding to quantiles with .05 intervals.
run_shiny_animaltracker

You can run the animaltracker 'shiny' app by calling this function.
save_meta

Save metadata to a data frame and return it
get_meta

Generate metadata for an animal data frame - filename, site, date min/max, animals, min/max lat/longitude, storage location
lookup_elevation_aws

Add elevation data from public AWS terrain tiles to long/lat coordinates of animal gps data
statsLabelOutput

'shiny' Module UI output for the animaltracker app's summary statistics labels.
line_compare

Compares moving averages of a variable for two datasets over time, grouped by GPS GPS, Date, and col columns should match
summarise_col

Get summary statistics for a single column in an animal data frame
statsLabel

'shiny' module server-side UI generator for the animaltracker app's summary statistics labels.
stats

'shiny' module server-side UI generator for the animaltracker app's summary statistics tables.
violin_compare

Compares summary statistics from two datasets as side-by-side violin plots
summarise_unit

Summarise a number of animal datasets by GPS unit
detect_peak_modz

Alternative implementation of the robust peak detection algorithm by van Brakel 2014 Classifies data points with modified z-scores greater than max_score as outliers ccording to Iglewicz and Hoaglin 1993
histogram_time_unit

Generates a histogram to visualize the distribution of time between GPS measurements by GPS unit.
demo_unfiltered_elev

Unfiltered demo animal GPS data from cows with elevation
demo_filtered

Filtered demo animal GPS data from cows
reactivePlot

'shiny' module server-side UI generator for the animaltracker app's summary statistics tables.
reactivePlotOutput

'shiny' module UI output for the animaltracker app's plots tab.
staticPicker

'shiny' module server-side UI generator for the animaltracker app's basic dropdown selections.
staticPickerOutput

Shiny Module UI output for the animaltracker app's basic dropdown selections.
statsOutput

'shiny' module UI output for the animaltracker app's summary statistics tables.
join_summaries

Joins two animal data frame summaries by a column and appends differences
read_columbus

Read and process a Columbus P-1 data file containing NMEA records into a data frame
time

'shiny' module server-side UI generator for the animaltracker app's time input.
timeOutput

'shiny' module UI output for the animaltracker app's time input
read_gps

Reads a GPS dataset of unknown format at location filename
app_ui

Defines a user interface for the 'shiny' app
app_server

Defines logic for updating the app based on user interaction in the ui
clean_export_files

Cleans all animal GPS datasets (in .csv format) in a chosen directory. Optionally exports the clean data as spreadsheets, a single .rds data file, or as a list of data frames
boxplot_altitude

Generates a boxplot to visualize the distribution of altitude by GPS.
calc_bearing

Helper function for cleaning Columbus P-1 datasets. Given lat and long coords in degree decimal, convert to radians and compute bearing.
clean_batch_df

Cleans a directory of animal data files
boxplot_time_unit

Generates a boxplot to visualize the distribution of time between GPS measurements by GPS unit.
clean_store_batch

Cleans a directory of animal data files and stores them locally in rds format
compare_flags

Joins and reformats two animal data frames for the purpose of flag comparison