knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>",
  fig.path = "README-"
)
knitr::include_graphics("./inst/lagos_banner2.png")

Project Status: Active - The project has reached a stable, usable state and is being actively developed. Travis-CI Build Status CRAN_Status_Badge CRAN RStudio mirror downloads

The LAGOSNE package provides an R interface to download LAGOS-NE data from remote databases, store this data locally, and perform a variety of filtering and subsetting operations.

Installation

# install stable version from CRAN
install.packages("LAGOSNE")

# install development version from Github
# install devtools if not found - install.packages("devtools")
# devtools::install_github("cont-limno/LAGOSNE", update_dependencies = TRUE)

Data

The lagosne_get function downloads the LAGOSNE files corresponding to the specified version from the EDI data repository. Files are stored in a temporary directory before being "compiled" to an R data format in the location returned by rappdirs::user_data_dir(). Data only needs to be downloaded one time per version per machine. The latest version of the LAGOSNE dataset is 1.087.1.

library(LAGOSNE)
lagosne_get("1.087.1")

Usage

Load Package

library(LAGOSNE)

Load data

The lagosne_load function returns a named list of data.frame objects. Use the names() function to see a list of available data.frames.

dt <- lagosne_load(version = "1.087.1")
names(dt)

Preview a table

head(dt$county)

Read table metadata

loadNamespace("printr")
help.search("datasets", package = "LAGOSNE")
unloadNamespace("printr")

Select data

lagosne_select is a convenience function whose primary purpose is to provide users with the ability to select subsets of LAGOS tables that correspond to specific keywords (see LAGOS:::keyword_partial_key()). See here for a comprehensive tutorial on generic data.frame subsetting.

# specific variables
 head(lagosne_select(table = "epi_nutr", vars = c("tp", "tn")))
 head(lagosne_select(table = "iws.lulc", vars = c("iws_nlcd2011_pct_95")))

# categories
head(lagosne_select(table = "epi_nutr", categories = "waterquality"))
head(lagosne_select(table = "county.chag", categories = "hydrology"))
head(lagosne_select(table = "hu4.chag", categories = "deposition")[,1:4])

# mix of specific variables and categories
head(lagosne_select(table = "epi_nutr", vars = "lagoslakeid", categories = c("waterquality")))

Published LAGOSNE subsets

# Oliver et al. 2015
lagos_get_oliver_2015()
dt <- lagos_load_oliver_2015()
head(dt)

Legacy Versions

R Package

To install versions of LAGOSNE compatible with older versions of LAGOS-NE run the following command where ref is set to the desired version (in the example, it is version 1.054.1):

# install devtools if not found
# install.packages("devtools")
devtools::install_github("cont-limno/LAGOSNE", ref = "v1.054.1")

Data

Until older datasets have been made available in a public repository, LAGOSNE users will need to use the lagosne_compile function (not lagosne_get) and supply the path to their local locus, limno and geo data folders. Replace the paths in the example below with the path to each respective folder on your system. Most people will have access to these folders through Dropbox. For example, the limno_folder would be assigned to something like: C:/Users/FWL/Dropbox/CSI_LAGOS-exports/LAGOS-NE-LIMNO-EXPORT

library(LAGOSNE)
lagosne_compile("1.054.1", format = "rds",
  limno_folder = "~/Downloads/LAGOS-NE-LIMNO-EXPORT",
  geo_folder   = "~/Downloads/LAGOS-NE-GEO-EXPORT",
  locus_folder = "~/Downloads/LAGOS-NE-LOCUS-EXPORT")

References

Oliver, SK, PA Soranno, CE Fergus, T Wagner, K Webster, CE Scott, LA Winslow, J Downing, and EH Stanley. 2015. “LAGOS - Predicted and Observed Maximum Depth Values for Lakes in a 17-State Region of the U.S.” https://dx.doi.org/10.6073/pasta/edc06bbae6db80e801b6e52253f2ea09.

Soranno, P.A., Bacon, L.C., Beauchene, M., Bednar, K.E., Bissell, E.G., Boudreau, C.K., Boyer, M.G., Bremigan, M.T., Carpenter, S.R., Carr, J.W. Cheruvelil, K.S., and ... , 2017. LAGOS-NE: A multi-scaled geospatial and temporal database of lake ecological context and water quality for thousands of US lakes. GigaScience, https://doi.org/10.1093/gigascience/gix101

Soranno, PA, EG Bissell, KS Cheruvelil, ST Christel, SM Collins, CE Fergus, CT Filstrup, et al. 2015. “Building a Multi-Scaled Geospatial Temporal Ecology Database from Disparate Data Sources: Fostering Open Science and Data Reuse.” Gigascience 4 (1). https://dx.doi.org/10.1186/s13742-015-0067-4.

Stachelek, J, and SK Oliver. 2017. LAGOSNE: Interface to the Lake Multi-Scaled Geospatial and Temporal Database. https://github.com/cont-limno/LAGOSNE.

Soranno P, Cheruvelil K. 2017. LAGOS-NE-LOCUS v1.01: a module for LAGOS-NE, a multi-scaled geospatial and temporal database of lake ecological context and water quality for thousands of U.S. Lakes: 1925–2013. Environmental Data Initiative. http://doi.org/ckpj

Soranno P, Cheruvelil K. 2017. LAGOS-NE-LIMNO v1.087.1: a module for LAGOS-NE, a multi-scaled geospatial and temporal database of lake ecological context and water quality for thousands of U.S. Lakes: 1925–2013. Environmental Data Initiative. http://doi.org/ckpk.

Soranno P, Cheruvelil K. 2017. LAGOS-NE-GEO v1.05: a module for LAGOS-NE, a multi-scaled geospatial and temporal database of lake ecological context and water quality for thousands of U.S. Lakes: 1925–2013. Environmental Data Initiative. http://doi.org/ckpm



cont-limno/LAGOS documentation built on Aug. 13, 2018, 7:17 p.m.