nlaR

lifecycle CRAN status Travis-CI Build Status

The goal of nlaR is to provide an R interface to the National Lakes Assessment data. At this point it serves either the 2007 or 2012 data (see examples below).

Installation

You can install nlaR from Github with:

# install.packages("devtools")
devtools::install_github("jsta/nlaR")

Usage

Load package

library(nlaR)

Retrieve data from EPA Website

Turn on automated data storage at the location returned by rappdirs::user_data_dir()

nla_get(2012, use_rappdirs = TRUE)

Load data from local machine

dt <- nla_load(2012)

View NLA tables

names(dt)
#>  [1] "algaltoxins"    "atrazine"       "bentcond"       "bentmet"       
#>  [5] "benttaxa_wide"  "chla_wide"      "phytocnt"       "phytotaxa_wide"
#>  [9] "secchi"         "topsedhg"       "waterchem_wide" "wide_benthic"  
#> [13] "wide_phab"      "wide_phabmet"   "wide_profile"   "wide_siteinfo" 
#> [17] "zoopcond"       "zoopmets"       "zooptaxa_wide"
head(dt$phytocnt)
#>   PUBLICATION_DATE  UID SAMPLE_TYPE TAXA_ID        PARAMETER   RESULT
#> 1        2/12/2014 6160        PHYL    4075        BIOVOLUME 219.9113
#> 2        2/12/2014 6160        PHYL    4075          DENSITY       25
#> 3        2/12/2014 6160        PHYL    4075   INITIAL_VOLUME     1080
#> 4        2/12/2014 6160        PHYL    4095 SUBSAMPLE_VOLUME      200
#> 5        2/12/2014 6160        PHYL    4095   VOLUME_COUNTED       10
#> 6        2/12/2014 6160        PHYL    4095       TOTAL_AREA 283.5287

More Examples

See vignettes.

References