Type: | Package |
Title: | Adirondack Long-Term Lake Data |
Version: | 0.6.1 |
Description: | Package for the access and distribution of Long-term lake datasets from lakes in the Adirondack Park, northern New York state. Includes a wide variety of physical, chemical, and biological parameters from 28 lakes. Data are from multiple collection organizations and have been harmonized in both time and space for ease of reuse. |
License: | MIT + file LICENSE |
Imports: | rappdirs, httr, tools, utils |
Suggests: | ggplot2, maps, testthat, sf |
Repository: | CRAN |
BugReports: | https://github.com/lawinslow/adklakedata/issues |
Encoding: | UTF-8 |
LazyData: | true |
RoxygenNote: | 6.0.1 |
NeedsCompilation: | no |
Packaged: | 2018-02-16 15:34:27 UTC; lawinslow |
Author: | Luke Winslow [aut, cre], Taylor Leach [aut], Tobi Hahn [aut] |
Maintainer: | Luke Winslow <lawinslow@gmail.com> |
Date/Publication: | 2018-02-16 19:08:16 UTC |
Load ADK Data
Description
Loads data from locally downloaded CSV files. Run check_dl_data
before using this function.
Usage
adk_data(data_name)
Arguments
data_name |
A string choosing the data to load.
|
Examples
## Not run:
#grab secchi data and plot it
secchi = adk_data('secchi')
plot(as.POSIXct(secchi$date), secchi$secchi)
## End(Not run)
Return path to Lake Polygons Shapefile
Description
Returns the path to the shapefile for the study Lake polygons. The source is a locally stored shapefile that can be used for mapping and analysis.
Usage
adk_lake_shapes()
Examples
library(sf)
bl = read_sf(adklakedata::adk_shape())
lakes = read_sf(adklakedata::adk_lake_shapes())
plot(st_geometry(bl))
plot(st_geometry(lakes), add=TRUE, col='blue')
List of lakes with attributes
Description
Returns a data.frame of lake info. Includes common info like lake location (lat/lon), lake name, and numerical site ID.
Usage
adk_lakes()
Examples
## Not run:
sites = adk_lakes()
## End(Not run)
Get data table metadata info
Description
Function to recall metadata about each dataset. Includes units and long-name of parameters. Prints info to console as well as returning text.
Usage
adk_metadata(data_name)
Arguments
data_name |
character name of dataset. See |
Examples
## Not run:
#Get chemistry metadata
adk_metadata('chem')
## End(Not run)
Return path to Adirondack Park Shapefile
Description
Returns the path to the shapefile for the Adirondack Park outline (The "Blue Line"). Returns the path to a locally stored shapefile that can be used for mapping and analysis.
Usage
adk_shape()
Examples
library(sf)
bl = read_sf(adklakedata::adk_shape())
lakes = read_sf(adklakedata::adk_lake_shapes())
plot(st_geometry(bl))
plot(st_geometry(lakes), add=TRUE, col='blue')
Download lake data from internet
Description
Check that we have local cache of ADK lake data. If it is not locally available, download the data from the internet and prepare it for local use. This only needs to be run once for each install of the package. Note: you will be required to re-download data when a new version of the package is released. This ensures stale data are not being accidentally used.
Usage
check_dl_data()
Verify and download data files
Description
Checks if local data files as defined in master file exist and match MD5 hash. Downloads data if necessary.
Usage
check_dl_file(master_file, fname = NULL, md5check = TRUE,
dest = local_path())
Arguments
master_file |
Character path to master file |
fname |
Character vector of specific file names to check |
md5check |
boolean |
dest |
Character path to download destination |
Get local file path
Description
Data files are locally cached (they are too large to be distributed
with the CRAN package). These cached files are stored in your user
data directory, or a custom directory set using set_local_path
.
Usage
local_path()
Value
Path to local file cache location
Examples
# set custom path to local temp directory
set_local_path(tempdir())
#returns current local path directory
local_path()
Set custom local file path
Description
Data files are locally cached (they are too large to be distributed
with the CRAN package). These cached files are stored in your user
data directory, or a custom directory set using set_local_path
.
Usage
set_local_path(path)
Arguments
path |
Full path to custom folder, will be created if it doesn't exist. |
Examples
# set custom path to local temp directory
set_local_path(tempdir())