diff --git a/R/LAGOSUS-package.R b/R/LAGOSUS-package.R index 21cfdb9..96441c9 100644 --- a/R/LAGOSUS-package.R +++ b/R/LAGOSUS-package.R @@ -67,7 +67,7 @@ lagosus_version <- function(){ #' #' @eval c("@details", get_table_metadata("locus", "lake_information")) #' -#' @name locus_information +#' @name lake_information #' @docType data #' @keywords datasets NULL @@ -81,7 +81,7 @@ NULL #' #' @eval c("@details", get_table_metadata("locus", "lake_characteristics")) #' -#' @name locus_characteristics +#' @name lake_characteristics #' @docType data #' @keywords datasets NULL @@ -93,7 +93,7 @@ NULL #' #' @eval c("@details", get_table_metadata("locus", "lake_watersheds")) #' -#' @name locus_watersheds +#' @name lake_watersheds #' @docType data #' @keywords datasets #' @aliases watersheds @@ -108,7 +108,7 @@ NULL #' #' @eval c("@details", get_table_metadata("locus", "lake_link")) #' -#' @name locus_link +#' @name lake_link #' @docType data #' @keywords datasets NULL @@ -117,7 +117,7 @@ NULL #' #' @eval get_table_metadata("locus", "source_table_locus") #' -#' @name locus_source +#' @name source_table_locus #' @docType data #' @keywords datasets NULL diff --git a/R/coordinates.R b/R/coordinates.R index 20eec7b..b96cf89 100644 --- a/R/coordinates.R +++ b/R/coordinates.R @@ -13,7 +13,7 @@ #' @export #' @examples \dontrun{ #' dt <- lagosus_load("locus") -#' res <- coordinatize(dt$locus$locus_information) +#' res <- coordinatize(dt$locus$lake_information) #' #' library(maps) #' map("state", xlim = c(-97.90363, -66.99892), ylim = c(34.61761, 49.41941)) diff --git a/R/info.R b/R/info.R index fe01275..bf2b46e 100644 --- a/R/info.R +++ b/R/info.R @@ -60,7 +60,7 @@ lake_info <- function(lagoslakeid = NA, name = NA, state = NA, suppressWarnings( name_state <- dplyr::left_join( name_state, - dplyr::select(lg$locus$locus_information, .data$lagoslakeid, + dplyr::select(lg$locus$lake_information, .data$lagoslakeid, .data$lake_centroidstate, .data$lake_namegnis, .data$state_zoneid), by = "lagoslakeid")) @@ -79,8 +79,8 @@ lake_info <- function(lagoslakeid = NA, name = NA, state = NA, } locus_state_conn <- suppressMessages(dplyr::left_join( - lg$locus$locus_information, - dplyr::select(lg$locus$locus_characteristics, + lg$locus$lake_information, + dplyr::select(lg$locus$lake_characteristics, .data$lake_connectivity_permanent, .data$lagoslakeid, .data$lake_totalarea_ha), by = c("lagoslakeid" = "lagoslakeid") @@ -88,7 +88,7 @@ lake_info <- function(lagoslakeid = NA, name = NA, state = NA, locus_state_iws <- suppressMessages(dplyr::left_join( locus_state_conn, - dplyr::select(lg$locus$locus_watersheds, + dplyr::select(lg$locus$lake_watersheds, .data$lagoslakeid, .data$ws_area_ha), by = c("lagoslakeid" = "lagoslakeid") )) diff --git a/README.Rmd b/README.Rmd index 3e06c34..b56e45b 100644 --- a/README.Rmd +++ b/README.Rmd @@ -84,7 +84,7 @@ names(lg) #### Preview a table ```{r preview table, eval=FALSE} -head(lg$locus$locus_characteristics) +head(lg$locus$lake_characteristics) ``` #### Preview a specific lake diff --git a/README.md b/README.md index 6e051ec..c956901 100644 --- a/README.md +++ b/README.md @@ -108,7 +108,7 @@ names(lg) #### Preview a table ``` r -head(lg$locus$locus_characteristics) +head(lg$locus$lake_characteristics) ``` #### Preview a specific lake diff --git a/data-raw/create_test_data.R b/data-raw/create_test_data.R index 4099eca..79baefa 100644 --- a/data-raw/create_test_data.R +++ b/data-raw/create_test_data.R @@ -6,7 +6,7 @@ dt <- LAGOSUS::lagosus_load(modules = c("locus", "depth")) # id 2 llids with non-missing chla data in two different states set.seed(5) -llids <- dplyr::select(dt$locus$locus_information, +llids <- dplyr::select(dt$locus$lake_information, lake_centroidstate, lagoslakeid) %>% dplyr::filter(lake_centroidstate %in% c("MA", "IA")) %>% group_by(lake_centroidstate) %>% diff --git a/data/lg_subset.rda b/data/lg_subset.rda index 39ef41a..f355068 100644 Binary files a/data/lg_subset.rda and b/data/lg_subset.rda differ diff --git a/inst/lagos_test_subset.rds b/inst/lagos_test_subset.rds index 1f9e003..f534042 100644 Binary files a/inst/lagos_test_subset.rds and b/inst/lagos_test_subset.rds differ diff --git a/man/coordinatize.Rd b/man/coordinatize.Rd index 8f9ec86..ecb4da2 100644 --- a/man/coordinatize.Rd +++ b/man/coordinatize.Rd @@ -30,7 +30,7 @@ default projection. \examples{ \dontrun{ dt <- lagosus_load("locus") -res <- coordinatize(dt$locus$locus_information) +res <- coordinatize(dt$locus$lake_information) library(maps) map("state", xlim = c(-97.90363, -66.99892), ylim = c(34.61761, 49.41941)) diff --git a/man/lake_characteristics.Rd b/man/lake_characteristics.Rd new file mode 100644 index 0000000..bc352b7 --- /dev/null +++ b/man/lake_characteristics.Rd @@ -0,0 +1,42 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/LAGOSUS-package.R +\docType{data} +\name{lake_characteristics} +\alias{lake_characteristics} +\title{LAGOSUS Lake characteristics} +\description{ +Includes derived metrics for each lake such as lake geometry (e.g., area, +perimeter, shape metrics), lake connectivity (e.g., lake connectivity +class, number of upstream lakes), and whether the lake is located within an +area that was glaciated during the Late Wisconsin glaciation. +} +\details{ +\tabular{lll}{ +\bold{Variable name} \tab \bold{Variable description} \tab \bold{Units} \cr +lagoslakeid \tab unique lake identifier developed by LAGOS-US \tab \cr +lake_waterarea_ha \tab surface area of lake waterbody polygon from NHD comprised of open water; islands are excluded \tab hectare\cr +lake_totalarea_ha \tab total area of the lake waterbody polygon from the NHD; includes combined area of open water and any islands within the outer boundary \tab hectare\cr +lake_islandarea_ha \tab surface area of any islands contained within the outer boundary of the lake waterbody polygon from NHD \tab hectare\cr +lake_perimeter_m \tab perimeter of outer boundary of lake waterbody polygon from the NHD; excludes perimeter of any islands \tab meter \cr +lake_islandperimeter_m \tab perimeter of islands contained within the outer boundary of the lake waterbody polygon from the NHD \tab meter \cr +lake_shorelinedevfactor \tab shoreline development factor; calculated as lake_perimeter_m divided by the product of 2 times the square root of pi times lake_waterarea_ha \tab \cr +lake_mbgconhull_length_m \tab the maximum possible distance between any two vertices of the minimum bounding geometry convex hull that encloses the lake polygon \tab meter \cr +lake_mbgconhull_width_m \tab the maximum width of the lake convex hull polygon along an axis perpendicular to the axis defined by the convex hull length \tab meter \cr +lake_mbgconhull_orientation_deg \tab orientation of the line defining the convex hull length; calculated as decimal degrees clockwise from north \tab degree \cr +lake_mbgrect_length_m \tab length of the minimum bounding geometry rectangle by area enclosing the lake polygon \tab meter \cr +lake_mbgrect_width_m \tab width of the minimum bounding geometry rectangle by area enclosing the lake polygon \tab meter \cr +lake_mbgrect_arearatio \tab ratio between lake_waterarea_ha converted to meters squared and the product of lake_mbgrect_length_m and lake_mbgrect_width_m; values near 1 indicate rectangular lake shape \tab \cr +lake_meanwidth_m \tab mean width of the lake; calculated as lake_waterarea_ha converted to meters squared divided by lake_mbgconhull_length_m \tab meter \cr +lake_connectivity_class \tab maximum hydrologic connectivity class of the focal lake determined from the NHD network considering both permanent and intermittent-ephemeral flow \tab \cr +lake_connectivity_fluctuates \tab indicates whether the lake connectivity classification depends on non-permanent flow \tab \cr +lake_connectivity_permanent \tab hydrologic connectivity class of the focal lake determined from the NHD network considering only permanent flow \tab \cr +lake_lakes1ha_upstream_ha \tab total area of lakes greater than or equal to 1 ha upstream of the focal lake, connected via surface streams \tab hectare\cr +lake_lakes4ha_upstream_ha \tab total area of lakes greater than or equal to 4 ha upstream of the focal lake, connected via surface streams \tab hectare\cr +lake_lakes10ha_upstream_ha \tab total area of lakes greater than or equal to 10 ha upstream of the focal lake, connected via surface streams \tab hectare\cr +lake_lakes1ha_upstream_n \tab count of lakes greater than or equal to 1 ha upstream of the focal lake, connected via surface streams \tab count \cr +lake_lakes4ha_upstream_n \tab count of lakes greater than or equal to 4 ha upstream of the focal lake, connected via surface streams \tab count \cr +lake_lakes10ha_upstream_n \tab count of lakes greater than or equal to 10 ha upstream of the focal lake, connected via surface streams \tab count \cr +lake_glaciatedlatewisc \tab glaciation status during the Late Wisconsin glaciation; Glaciated status is assigned if any part of the lake polygon is inside the glacial extent \tab +} +} +\keyword{datasets} diff --git a/man/lake_information.Rd b/man/lake_information.Rd new file mode 100644 index 0000000..117cbd1 --- /dev/null +++ b/man/lake_information.Rd @@ -0,0 +1,52 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/LAGOSUS-package.R +\docType{data} +\name{lake_information} +\alias{lake_information} +\title{LAGOSUS Lake information} +\description{ +Includes information about lake identifiers used in LAGOS-US, information +about lake location (i.e., lat, lon, and elevation), and the zone IDs for +each spatial division containing the lake (e.g., state, county, hydrologic +unit). +} +\details{ +\tabular{lll}{ +\bold{Variable name} \tab \bold{Variable description} \tab \bold{Units} \cr +lagoslakeid \tab unique lake identifier developed by LAGOS-US \tab \cr +lake_nhdid \tab the unique Permanent_Identifier from the NHD for each LAGOS lake \tab \cr +lake_nhdfcode \tab NHD five-digit integer code with feature code plus additional characteristics or values \tab \cr +lake_nhdftype \tab NHD three-digit integer code providing a unique identifier of feature type for the waterbody \tab \cr +lake_reachcode \tab reach code assigned to the water feature by the NHD \tab \cr +lake_namegnis \tab lake name from the GNIS database \tab \cr +lake_namelagos \tab lake name from a combination of data sources; examples are GNIS, WQP, etc. \tab \cr +lake_onlandborder \tab flag indicating lake polygon is adjacent to or crosses the border with Canada or Mexico \tab \cr +lake_ismultipart \tab flag indicating that the focal lake polygon is multipart \tab \cr +lake_missingws \tab flag indicating that the WS for the lake was not delineated \tab \cr +lake_shapeflag \tab flag indicating lake polygon shape is angular, either triangular or rectangular, or is elongate and very thin relative to length; respectively may indicate the lake is less likely to be natural in origin or is more riverine \tab \cr +lake_lat_decdeg \tab latitude of centroid of the NHD lake polygon in decimal degrees; NAD83 projection \tab decimal degree\cr +lake_lon_decdeg \tab longitude of centroid of the NHD lake polygon in decimal degrees; NAD83 projection \tab decimal degree\cr +lake_elevation_m \tab the elevation of the lake polygon centroid, in meters; referenced to the North American Vertical Datum of 1988 or NAVD88 and obtained from the National Elevation Dataset \tab meter \cr +lake_centroidstate \tab two-letter postal abbreviation of the state containing the lake centroid \tab \cr +lake_states \tab two-letter postal abbreviations of all states intersecting the focal lake polygon \tab \cr +lake_county \tab name of county containing the focal lake polygon centroid \tab \cr +lake_countyfips \tab Federal Information Processing Standard, FIPS, code for the county containing the focal lake polygon centroid \tab \cr +lake_huc12 \tab the NHD code for the HUC12 containing the lake centroid \tab \cr +buff100_zoneid \tab unique 100 m buffer identifier assigned by LAGOS-US; identifier is equivalent to the focal lake lagoslakeid \tab \cr +buff500_zoneid \tab unique 500 m buffer identifier assigned by LAGOS-US; identifier is equivalent to the focal lake lagoslakeid \tab \cr +ws_zoneid \tab unique WS watershed identifier assigned by LAGOS-US; identifier is equivalent to the focal lake lagoslakeid \tab \cr +nws_zoneid \tab unique NWS watershed identifier assigned by LAGOS-US; identifier is equivalent to the focal lake lagoslakeid \tab \cr +hu12_zoneid \tab unique identifier assigned by LAGOS-US for zones in the spatial division HU12 \tab \cr +hu8_zoneid \tab unique identifier assigned by LAGOS-US for zones in the spatial division HU8 \tab \cr +hu4_zoneid \tab unique identifier assigned by LAGOS-US for zones in the spatial division HU4 \tab \cr +county_zoneid \tab unique identifier assigned by LAGOS-US for zones in the spatial division county \tab \cr +state_zoneid \tab unique identifier assigned by LAGOS-US for zones in the spatial division state \tab \cr +epanutr_zoneid \tab unique identifier assigned by LAGOS-US for zones in the spatial division EPA Nutrient Ecoregions \tab \cr +omernik3_zoneid \tab unique identifier assigned by LAGOS-US for zones in the spatial division Omernik Level III Ecoregions \tab \cr +wwf_zoneid \tab unique identifier assigned by LAGOS-US for zones in the spatial division World Wildlife Fund ecoregions \tab \cr +mlra_zoneid \tab unique identifier assigned by LAGOS-US for zones in the spatial division Major Land Areas \tab \cr +bailey_zoneid \tab unique identifier assigned by LAGOS-US for zones in the spatial division Bailey’s Ecoregions \tab \cr +neon_zoneid \tab unique identifier assigned by LAGOS-US for zones in the spatial division National Ecological Observation Network \tab +} +} +\keyword{datasets} diff --git a/man/locus_link.Rd b/man/lake_link.Rd similarity index 58% rename from man/locus_link.Rd rename to man/lake_link.Rd index 347eb92..c37ea90 100644 --- a/man/locus_link.Rd +++ b/man/lake_link.Rd @@ -1,8 +1,8 @@ % Generated by roxygen2: do not edit by hand % Please edit documentation in R/LAGOSUS-package.R \docType{data} -\name{locus_link} -\alias{locus_link} +\name{lake_link} +\alias{lake_link} \title{LAGOSUS Identifier links} \description{ Includes single or multiple identifiers per lake from other commonly used @@ -13,36 +13,36 @@ the EPA National Lake Assessment surveys from 2007 and 2012. \details{ \tabular{lll}{ \bold{Variable name} \tab \bold{Variable description} \tab \bold{Units} \cr -lagoslakeid \tab unique lake identifier developed by LAGOS-US \tab \cr -lake_nhdid \tab the unique 'Permanent_identifier' from the NHD for each LAGOS lake \tab \cr -lake_reachcode \tab reach code assigned to the water feature by the NHD \tab \cr -lake_namegnis \tab lake name from the gnis database \tab \cr -lake_namelagos \tab lake name from a combination of data sources (gnis, wqp, etc.) \tab \cr -lake_county \tab NULLme of county containing the focal lake polygon centroid \tab \cr -lake_countyfips \tab Federal Information Processing Standard (FIPS) code for the county containing the focal lake polygon centroid \tab \cr -lake_lat_decdeg \tab latitude of centroid of the NHD lake polygon in decimal degrees (NAD83) \tab decimal degree \cr -lake_lon_decdeg \tab longitude of centroid of the NHD lake polygon in decimal degrees (NAD83) \tab decimal degree \cr -lake_centroidstate \tab abbreviation of state containing the lake centroid \tab \cr -nhdhr_area_sqkm \tab NHD feature area in square kilometers \tab square kilometer\cr -nhdhr_fdate \tab date of last feature modification in National Hydrography Dataset \tab \cr -nhdhr_gnisid \tab unique identifier assigned by GNIS \tab \cr -lagosus_legacysiteid \tab Unique site/lake identifier from the original LAGOS-US water quality source dataset. This is not standardized and each source dataset has its own system. \tab \cr -lagosus_legacysitelabel \tab the column/field name used by the source dataset to label the legacy lake identifier \tab \cr -lagosus_legacyprogram \tab the program name assigned in LAGOS_US to identify the source dataset provider \tab \cr -wqp_monitoringlocationidentifier \tab a designator used to describe the unique name, number, or code assigned to identify the monitoring location \tab \cr -wqp_monitoringlocationname \tab the designator specified by the sampling organization for the site at which sampling or other activities are conducted \tab \cr -wqp_providername \tab the source system that provided data to the Water Quality Portal (NWIS, STORET, STEWARDS, etc) \tab \cr -nhdplusv2_comid \tab common identifier of the NHD Waterbody feature \tab \cr -nhdplusv2_reachcode \tab NHDplus v2 reach code assigned to the water feature. \tab \cr -nhdplusv2_area_sqkm \tab NHD feature area in square kilometers \tab square kilometer\cr -lagosne_lagoslakeid \tab unique lake identifier developed for LAGOS-NE \tab \cr -lagosne_legacysiteid \tab Unique site/lake identifier from the original LAGOS-NE water quality source dataset. This is not standardized and each source dataset has its own system. \tab \cr -nla2007_siteid \tab lake site identifier from National Lakes Assessment 2007 survey \tab \cr -nla2012_siteid \tab lake site identifier from National Lakes Assessment 2012 survey \tab \cr -nhdplusv2_lakes_n \tab count of WQP sites within the LAGOS-US lake \tab count \cr -lagosne_lakes_n \tab count of NHDPlusV2 polygons matching the LAGOS-US lagoslakeid \tab count \cr -wqp_sites_n \tab count of LAGOS-NE lagoslakeids matching the LAGOS-US lagoslakeid \tab count \cr -lagosus_legacyids_n \tab count of all LAGOS-US legacy (original) sampling site identifiers linked to the lagoslakeid in this table \tab count +lagoslakeid \tab unique lake identifier developed by LAGOS-US \tab \cr +lake_nhdid \tab the unique Permanent_Identifier from the NHD for each LAGOS lake \tab \cr +lake_reachcode \tab reach code assigned to the water feature by the NHD \tab \cr +lake_namegnis \tab lake name from the GNIS database \tab \cr +lake_namelagos \tab lake name from a combination of data sources; examples are GNIS, WQP, etc. \tab \cr +lake_county \tab name of county containing the focal lake polygon centroid \tab \cr +lake_countyfips \tab Federal Information Processing Standard, FIPS, code for the county containing the focal lake polygon centroid \tab \cr +lake_lat_decdeg \tab latitude of centroid of the NHD lake polygon in decimal degrees; NAD83 projection \tab decimal degree \cr +lake_lon_decdeg \tab longitude of centroid of the NHD lake polygon in decimal degrees; NAD83 projection \tab decimal degree \cr +lake_centroidstate \tab two-letter postal abbreviation of the state containing the lake centroid \tab \cr +nhdhr_area_sqkm \tab area of areal feature based on Albers Equal Area, as assigned in NHD \tab square kilometer\cr +nhdhr_fdate \tab date of last feature modification in National Hydrography Dataset \tab \cr +nhdhr_gnisid \tab unique identifier assigned by GNIS \tab \cr +lagosus_legacysiteid \tab unique site or lake identifier from the original LAGOS-US water quality source dataset--this is not standardized and each source dataset has its own system \tab \cr +lagosus_legacysitelabel \tab column name or field name used by the source dataset to label the legacy lake identifier \tab \cr +lagosus_legacyprogram \tab program name assigned in LAGOS-US to identify the source dataset provider \tab \cr +wqp_monitoringlocationidentifier \tab a designator used to describe the unique name, number, or code assigned to identify the monitoring location \tab \cr +wqp_monitoringlocationname \tab the designator specified by the sampling organization for the site at which sampling or other activities are conducted \tab \cr +wqp_providername \tab source system that provided data to the Water Quality Portal; examples are NWIS, STORET, STEWARDS, etc. \tab \cr +nhdplusv2_comid \tab common identifier of the NHD Waterbody feature \tab \cr +nhdplusv2_reachcode \tab NHDplus v2 reach code assigned to the water feature. \tab \cr +nhdplusv2_area_sqkm \tab feature area in square kilometers, as assigned by NHD \tab square kilometer\cr +lagosne_lagoslakeid \tab unique lake identifier developed for LAGOS-NE \tab \cr +lagosne_legacysiteid \tab unique site/lake identifier from the original LAGOS-NE water quality source dataset--this is not standardized and each source dataset has its own system \tab \cr +nla2007_siteid \tab lake site identifier from National Lakes Assessment 2007 survey \tab \cr +nla2012_siteid \tab lake site identifier from National Lakes Assessment 2012 survey \tab \cr +nhdplusv2_lakes_n \tab count of NHDPlusV2 polygons matching the LAGOS-US lagoslakeid \tab count \cr +lagosne_lakes_n \tab count of LAGOS-NE lagoslakeids matching the LAGOS-US lagoslakeid \tab count \cr +wqp_sites_n \tab count of WQP sites within the LAGOS-US lake \tab count \cr +lagosus_legacyids_n \tab count of all LAGOS-US legacy ids linked to the lagoslakeid in this table; these ids include, for example, original sampling site identifiers \tab count } } \keyword{datasets} diff --git a/man/lake_watersheds.Rd b/man/lake_watersheds.Rd new file mode 100644 index 0000000..779ca95 --- /dev/null +++ b/man/lake_watersheds.Rd @@ -0,0 +1,55 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/LAGOSUS-package.R +\docType{data} +\name{lake_watersheds} +\alias{lake_watersheds} +\alias{watersheds} +\title{LAGOSUS Lake watersheds} +\description{ +Includes identifiers, location, and geometry for the calculated watersheds (WS) and network +watersheds (NWS). +} +\details{ +\tabular{lll}{ +\bold{Variable name} \tab \bold{Variable description} \tab \bold{Units} \cr +lagoslakeid \tab unique lake identifier developed by LAGOS-US \tab \cr +ws_zoneid \tab unique WS watershed identifier assigned by LAGOS-US; identifier is equivalent to the focal lake lagoslakeid \tab \cr +nws_zoneid \tab unique NWS watershed identifier assigned by LAGOS-US; identifier is equivalent to the focal lake lagoslakeid \tab \cr +ws_subtype \tab watershed subtype class for the watershed; LC equals local catchment, DWS equals drainage-watershed, IDWS equals inter-drainage-lake watershed \tab \cr +ws_equalsnws \tab flag indicating that the ws is equivalent to the nws \tab \cr +ws_onlandborder \tab flag indicating zone is adjacent to or crosses the border with Canada or Mexico \tab \cr +ws_oncoast \tab flag indicating the zone is adjacent to the coastline \tab \cr +ws_inusa_pct \tab percent of the zone polygon that is within the US border \tab percent \cr +ws_includeshu4inlet \tab flag indicating the WS extends beyond the focal HU4 and is connected via an inlet to an adjoining HU4 \tab \cr +ws_ismultipart \tab flag indicating that the focal zone polygon is multipart \tab \cr +ws_sliverflag \tab flag indicating extreme cases where the watershed is comprised of slivers due to flat or constrained terrain that may not accurately reflect surface drainage \tab \cr +nws_onlandborder \tab flag indicating zone is adjacent to or crosses the border with Canada or Mexico \tab \cr +nws_oncoast \tab flag indicating the zone is adjacent to the coastline \tab \cr +nws_inusa_pct \tab percent of the zone polygon that is within the US border \tab percent \cr +nws_includeshu4inlet \tab flag indicating the NWS extends beyond the focal HU4 and is connected via an inlet to an adjoining HU4 \tab \cr +nws_ismultipart \tab flag indicating that the focal zone polygon is multipart \tab \cr +ws_states \tab two-letter postal abbreviations of all states intersecting the zone polygon \tab \cr +ws_focallakewaterarea_ha \tab surface area of focal lake for which the WS is calculated \tab hectare \cr +ws_area_ha \tab area of zone polygon \tab hectare \cr +ws_perimeter_m \tab perimeter of zone polygon including perimeter of any internal holes \tab meter \cr +ws_lake_arearatio \tab ratio between WS area and lake water area \tab \cr +ws_mbgconhull_length_m \tab the maximum possible distance between any two vertices of the minimum bounding geometry convex hull that encloses the WS polygon \tab meter \cr +ws_mbgconhull_width_m \tab the maximum width of the WS convex hull polygon along an axis perpendicular to the axis defined by the convex hull length \tab meter \cr +ws_mbgconhull_orientation_deg \tab orientation of the line defining the convex hull length; calculated as decimal degrees clockwise from north \tab degree \cr +ws_meanwidth_m \tab mean width of the WS polygon; calculated as ws_area_ha converted to hectares and divided by ws_mbgconhull_length_m \tab meter \cr +ws_lat_decdeg \tab latitude of the centroid of the focal lake polygon in decimal degrees; NAD83 projection \tab decimaldegree \cr +ws_lon_decdeg \tab longitude of the centroid of the focal lake polygon in decimal degrees; NAD83 projection \tab decimaldegree \cr +nws_states \tab two-letter postal abbreviations of all states intersecting the zone polygon \tab \cr +nws_focallakewaterarea_ha \tab surface area of focal lake for which the NWS is calculated \tab hectare \cr +nws_area_ha \tab area of zone polygon \tab hectare \cr +nws_perimeter_m \tab perimeter of zone polygon including perimeters of any internal holes \tab meter \cr +nws_lake_arearatio \tab ratio between NWS area and lake water area \tab \cr +nws_mbgconhull_length_m \tab the maximum possible distance between any two vertices of the minimum bounding geometry convex hull that encloses the NWS polygon \tab meter \cr +nws_mbgconhull_width_m \tab the maximum width of the NWS convex hull polygon along an axis perpendicular to the axis defined by the convex hull length \tab meter \cr +nws_mbgconhull_orientation_deg \tab orientation of the line defining the convex hull length; calculated as decimal degrees clockwise from north \tab degree \cr +nws_meanwidth_m \tab mean width of the NWS polygon; calculated as nws_area_ha converted to hectares and divided by nws_mbgconhull_length_m \tab meter \cr +nws_lat_decdeg \tab latitude of the centroid of the focal lake polygon in decimal degrees; NAD83 projection \tab decimal degree\cr +nws_lon_decdeg \tab longitude of the centroid of the focal lake polygon in decimal degrees; NAD83 projection \tab decimal degree +} +} +\keyword{datasets} diff --git a/man/locus_characteristics.Rd b/man/locus_characteristics.Rd deleted file mode 100644 index 873c7e8..0000000 --- a/man/locus_characteristics.Rd +++ /dev/null @@ -1,43 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/LAGOSUS-package.R -\docType{data} -\name{locus_characteristics} -\alias{locus_characteristics} -\title{LAGOSUS Lake characteristics} -\description{ -Includes derived metrics for each lake such as lake geometry (e.g., area, -perimeter, shape metrics), lake connectivity (e.g., lake connectivity -class, number of upstream lakes), and whether the lake is located within an -area that was glaciated during the Late Wisconsin glaciation. -} -\details{ -\tabular{lll}{ -\bold{Variable name} \tab \bold{Variable description} \tab \bold{Units} \cr -lagoslakeid \tab unique lake identifier developed by LAGOS-US \tab \cr -lake_waterarea_ha \tab surface area of lake waterbody polygon from NHD (excludes islands) \tab hectare\cr -lake_totalarea_ha \tab surface area within outer boundary of lake waterbody polygon from NHD (includes islands) \tab hectare\cr -lake_islandarea_ha \tab surface area of islands within outer boundary of lake waterbody polygon from NHD \tab hectare\cr -lake_perimeter_m \tab perimeter of outer boundary of lake waterbody polygon from the NHD (excludes islands) \tab meter \cr -lake_islandperimeter_m \tab perimeter of islands within the lake waterbody polygon from the NHD \tab meter \cr -lake_shorelinedevfactor \tab shoreline development factor = lake_perimeter / (2*?(?\emph{waterarea)) \tab \cr -lake_mbgconhull_length_m \tab the longest distance entirely within the lake polygon between any two vertices of the minimum bounding geometry convex hull that encloses the lake polygon \tab meter \cr -lake_mbgconhull_width_m \tab the shortest distance entirely within the lake polygon between any two vertices of the minimum bounding geometry convex hull that encloses the lake polygon \tab meter \cr -lake_mbgconhull_orientation_deg \tab orientation (from 0 to 180 decimal degrees clockwise from north) of the longest line connecting two vertices entirely within both the convex hull and the lake polygon \tab degree \cr -lake_mbgrect_length_m \tab length of the minimum bounding geometry rectangle by area enclosing the lake polygon \tab meter \cr -lake_mbgrect_width_m \tab width of the minimum bounding geometry rectangle by area enclosing the lake polygon \tab meter \cr -lake_mbgrect_arearatio \tab ratio between lake_waterarea_ha (} 10000 m^2/ha) and the area of the minimum bounding rectangle by area of the lake polygon; value near 1 indicates lake shape is rectangular -\tab \cr -lake_meanwidth_m \tab mean width of the lake calculated as lake water area (lake_area_ha* 10000 m^2/ha) divided by the convex hull length of the focal lake polygon (lake_mbgconhull_length_m) \tab meter \cr -lake_connectivity_class \tab hydrologic connectivity class of the focal lake determined from the NHD network considering both permanent and intermittent/ephemeral flow \tab \cr -lake_connectivity_fluctuates \tab indicates whether the lake's connectivity classification depends on non-permanent flow \tab \cr -lake_connectivity_permanent \tab hydrologic connectivity class of the focal lake determined from the NHD network considering only permanent flow \tab \cr -lake_lakes1ha_upstream_ha \tab total area of lakes >= 1 ha upstream of the focal lake, connected via surface streams \tab hectare\cr -lake_lakes4ha_upstream_ha \tab total area of lakes >= 4 ha upstream of the focal lake, connected via surface streams \tab hectare\cr -lake_lakes10ha_upstream_ha \tab total area of lakes >= 10 ha upstream of the focal lake, connected via surface streams \tab hectare\cr -lake_lakes1ha_upstream_n \tab count of lakes >= 1 ha upstream of the focal lake, connected via surface streams \tab count \cr -lake_lakes4ha_upstream_n \tab count of lakes >= 4 ha upstream of the focal lake, connected via surface streams \tab count \cr -lake_lakes10ha_upstream_n \tab count of lakes >= 10 ha upstream of the focal lake, connected via surface streams \tab count \cr -lake_glaciatedlatewisc \tab glaciation status during the Late Wisconsin glaciation (status = Glaciated if any part of the lake polygon is inside the glacial extent) \tab -} -} -\keyword{datasets} diff --git a/man/locus_information.Rd b/man/locus_information.Rd deleted file mode 100644 index 4323137..0000000 --- a/man/locus_information.Rd +++ /dev/null @@ -1,52 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/LAGOSUS-package.R -\docType{data} -\name{locus_information} -\alias{locus_information} -\title{LAGOSUS Lake information} -\description{ -Includes information about lake identifiers used in LAGOS-US, information -about lake location (i.e., lat, lon, and elevation), and the zone IDs for -each spatial division containing the lake (e.g., state, county, hydrologic -unit). -} -\details{ -\tabular{lll}{ -\bold{Variable name} \tab \bold{Variable description} \tab \bold{Units} \cr -lagoslakeid \tab unique lake identifier developed by LAGOS-US \tab \cr -lake_nhdid \tab the unique 'Permanent_identifier' from the NHD for each LAGOS lake \tab \cr -lake_nhdfcode \tab NHD five-digit integer code with feature code plus additional characteristics/values \tab \cr -lake_nhdftype \tab NHD three-digit integer code providing a unique identifier of feature type for the waterbody \tab \cr -lake_reachcode \tab reach code assigned to the water feature by the NHD \tab \cr -lake_namegnis \tab lake name from the gnis database \tab \cr -lake_namelagos \tab lake name from a combination of data sources (gnis, wqp, etc.) \tab \cr -lake_onlandborder \tab flag indicating lake polygon is adjacent to or crosses the border with Canada or Mexico \tab \cr -lake_ismultipart \tab flag indicating that the focal lake polygon is multipart \tab \cr -lake_missingws \tab flag indicating that the lake's watershed (both ws and nws) was not delineated \tab \cr -lake_shapeflag \tab flag indicating lake polygon shape is excessively angular (e.g., triangle, rectangle) or elongate (very thin relative to length); may indicate the lake is not natural in origin (angular) or is more riverine (elongate) \tab \cr -lake_lat_decdeg \tab latitude of centroid of the NHD lake polygon in decimal degrees (NAD83) \tab decimal degree\cr -lake_lon_decdeg \tab longitude of centroid of the NHD lake polygon in decimal degrees (NAD83) \tab decimal degree\cr -lake_elevation_m \tab the elevation of the lake polygon centroid, in meters (referenced to the North American Vertical Datum of 1988 (NAVD88) and obtained from the National Elevation Dataset) \tab meter \cr -lake_centroidstate \tab abbreviation of state containing the lake centroid \tab \cr -lake_states \tab abbreviation(s) of state(s) intersecting the focal lake polygon \tab \cr -lake_county \tab NULLme of county containing the focal lake polygon centroid \tab \cr -lake_countyfips \tab Federal Information Processing Standard (FIPS) code for the county containing the focal lake polygon centroid \tab \cr -lake_huc12 \tab the code for the HUC12 containing the lake centroid \tab \cr -buff100_zoneid \tab unique 100 m buffer identifier assigned by LAGOS-US, equivalent to the focal lake lagoslakeid \tab \cr -buff500_zoneid \tab unique 500 m buffer identifier assigned by LAGOS-US, equivalent to the focal lake lagoslakeid \tab \cr -ws_zoneid \tab unique watershed identifier assigned by LAGOS-US, equivalent to the focal lake lagoslakeid \tab \cr -nws_zoneid \tab unique network watershed identifier assigned by LAGOS-US, equivalent to the focal lake lagoslakeid \tab \cr -hu12_zoneid \tab unique identifier assigned by LAGOS-US for zones in the spatial division HU12 \tab \cr -hu8_zoneid \tab unique identifier assigned by LAGOS-US for zones in the spatial division HU8 \tab \cr -hu4_zoneid \tab unique identifier assigned by LAGOS-US for zones in the spatial division HU4 \tab \cr -county_zoneid \tab unique identifier assigned by LAGOS-US for zones in the spatial division county \tab \cr -state_zoneid \tab unique identifier assigned by LAGOS-US for zones in the spatial division state \tab \cr -epanutr_zoneid \tab unique identifier assigned by LAGOS-US for zones in the spatial division EPA Nutrient Ecoregions \tab \cr -omernik3_zoneid \tab unique identifier assigned by LAGOS-US for zones in the spatial division Omernik Level III Ecoregions \tab \cr -wwf_zoneid \tab unique identifier assigned by LAGOS-US for zones in the spatial division World Wildlife Fund ecoregions \tab \cr -mlra_zoneid \tab unique identifier assigned by LAGOS-US for zones in the spatial division Major Land Areas \tab \cr -bailey_zoneid \tab unique identifier assigned by LAGOS-US for zones in the spatial division Bailey’s Ecoregions \tab \cr -neon_zoneid \tab unique identifier assigned by LAGOS-US for zones in the spatial division National Ecological Observation Network \tab -} -} -\keyword{datasets} diff --git a/man/locus_watersheds.Rd b/man/locus_watersheds.Rd deleted file mode 100644 index 175fcdc..0000000 --- a/man/locus_watersheds.Rd +++ /dev/null @@ -1,55 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/LAGOSUS-package.R -\docType{data} -\name{locus_watersheds} -\alias{locus_watersheds} -\alias{watersheds} -\title{LAGOSUS Lake watersheds} -\description{ -Includes identifiers, location, and geometry for the calculated watersheds (WS) and network -watersheds (NWS). -} -\details{ -\tabular{lll}{ -\bold{Variable name} \tab \bold{Variable description} \tab \bold{Units} \cr -lagoslakeid \tab unique lake identifier developed by LAGOS-US \tab \cr -ws_zoneid \tab unique watershed identifier assigned by LAGOS-US, equivalent to the focal lake lagoslakeid \tab \cr -nws_zoneid \tab unique network watershed identifier assigned by LAGOS-US, equivalent to the focal lake lagoslakeid \tab \cr -ws_subtype \tab LAGOS watershed subtype class for the watershed (LC=local catchment, DWS=drainage-watershed, IDWS=inter-drainage-lake watershed) \tab \cr -ws_equalsnws \tab flag indicating that the ws is equivalent to the nws (=Y where there are no upstream lakes > 10 ha and where lake connectivity class does not equal drainagelk) \tab \cr -ws_onlandborder \tab flag indicating zone is adjacent to or crosses the border with Canada or Mexico \tab \cr -ws_oncoast \tab flag indicating the zone is adjacent to the coastline \tab \cr -ws_inusa_pct \tab percent of the zone (i.e., polygon) that is within the US border \tab percent \cr -ws_includeshu4inlet \tab flag indicating the ws extends beyond the focal HU4 and is connected via an inlet to an adjoining HU4 \tab \cr -ws_ismultipart \tab flag indicating that the focal zone polygon is multipart \tab \cr -ws_sliverflag \tab flag indicating extreme cases where the watershed is comprised of slivers due to flat or constrained terrain that may not accurately reflect surface drainage \tab \cr -nws_onlandborder \tab flag indicating zone is adjacent to or crosses the border with Canada or Mexico \tab \cr -nws_oncoast \tab flag indicating the zone is adjacent to the coastline \tab \cr -nws_inusa_pct \tab percent of the zone (i.e., polygon) that is within the US border \tab percent \cr -nws_includeshu4inlet \tab flag indicating the nws extends beyond the focal HU4 and is connected via an inlet to an adjoining HU4 \tab \cr -nws_ismultipart \tab flag indicating that the focal zone polygon is multipart \tab \cr -ws_states \tab abbreviation(s) of state(s) intersecting the zone polygon \tab \cr -ws_focallakewaterarea_ha \tab surface area of focal lake for which the watershed (WS) is calculated \tab hectare \cr -ws_area_ha \tab area of zone polygon \tab hectare \cr -ws_perimeter_m \tab perimeter of zone polygon including perimeters of any internal 'holes' \tab meter \cr -ws_lake_arearatio \tab ratio between watershed area and lake water area \tab \cr -ws_mbgconhull_length_m \tab the longest distance entirely within the ws polygon between any two vertices of the minimum bounding geometry convex hull that encloses the ws polygon \tab meter \cr -ws_mbgconhull_width_m \tab the shortest distance entirely within the ws polygon between any two vertices of the minimum bounding geometry convex hull that encloses the ws polygon \tab meter \cr -ws_mbgconhull_orientation_deg \tab orientation (from 0 to 180 decimal degrees clockwise from north) of the longest line connecting two vertices entirely within both the convex hull and the ws polygon \tab degree \cr -ws_meanwidth_m \tab mean width of the ws calculated as ws area (ws_area_ha* 10000 m^2/ha) divided by the convex hull length of the focal ws polygon (ws_mbgconhull_length_m) \tab meter \cr -ws_lat_decdeg \tab latitude of the centroid of the focal lake polygon in decimal degrees (NAD83) \tab decimaldegree \cr -ws_lon_decdeg \tab longitude of the centroid of the focal lake polygon in decimal degrees (NAD83) \tab decimaldegree \cr -nws_states \tab abbreviation(s) of state(s) intersecting the zone polygon \tab \cr -nws_focallakewaterarea_ha \tab surface area of focal lake for which the network watershed (NWS) is calculated \tab hectare \cr -nws_area_ha \tab area of zone polygon \tab hectare \cr -nws_perimeter_m \tab perimeter of zone polygon including perimeters of any internal 'holes' \tab meter \cr -nws_lake_arearatio \tab ratio between network watershed area and lake water area \tab \cr -nws_mbgconhull_length_m \tab the longest distance entirely within the nws polygon between any two vertices of the minimum bounding geometry convex hull that encloses the nws polygon \tab meter \cr -nws_mbgconhull_width_m \tab the shortest distance entirely within the nws polygon between any two vertices of the minimum bounding geometry convex hull that encloses the nws polygon \tab meter \cr -nws_mbgconhull_orientation_deg \tab orientation (from 0 to 180 decimal degrees clockwise from north) of the longest line connecting two vertices entirely within both the convex hull and the nws polygon \tab degree \cr -nws_meanwidth_m \tab mean width of the nws calculated as nws area (nws_area_ha* 10000 m^2/ha) divided by the convex hull length of the focal nws polygon (nws_mbgconhull_length_m) \tab meter \cr -nws_lat_decdeg \tab latitude of the centroid of the focal lake polygon in decimal degrees (NAD83) \tab decimal degree\cr -nws_lon_decdeg \tab longitude of the centroid of the focal lake polygon in decimal degrees (NAD83) \tab decimal degree -} -} -\keyword{datasets} diff --git a/man/locus_source.Rd b/man/source_table_locus.Rd similarity index 97% rename from man/locus_source.Rd rename to man/source_table_locus.Rd index c44915e..5f002a4 100644 --- a/man/locus_source.Rd +++ b/man/source_table_locus.Rd @@ -1,8 +1,8 @@ % Generated by roxygen2: do not edit by hand % Please edit documentation in R/LAGOSUS-package.R \docType{data} -\name{locus_source} -\alias{locus_source} +\name{source_table_locus} +\alias{source_table_locus} \title{LAGOSUS Data sources} \description{ LAGOSUS Data sources diff --git a/tests/testthat/lagos_test_subset.rds b/tests/testthat/lagos_test_subset.rds index 1f9e003..f534042 100644 Binary files a/tests/testthat/lagos_test_subset.rds and b/tests/testthat/lagos_test_subset.rds differ diff --git a/tests/testthat/test-coordinates.R b/tests/testthat/test-coordinates.R index 29c8de9..16d8da3 100644 --- a/tests/testthat/test-coordinates.R +++ b/tests/testthat/test-coordinates.R @@ -3,7 +3,7 @@ context("coordinates") test_that("coordinatize works", { # dt <- readRDS("inst/lagos_test_subset.rds") dt <- readRDS("lagos_test_subset.rds") - res <- coordinatize(dt$locus$locus_information) + res <- coordinatize(dt$locus$lake_information) expect_equal(nrow(res), 2) expect_s3_class(res, "sf") diff --git a/tests/testthat/test-display-names.R b/tests/testthat/test-display-names.R index 1382034..d9b1cce 100644 --- a/tests/testthat/test-display-names.R +++ b/tests/testthat/test-display-names.R @@ -8,6 +8,6 @@ test_that("display_names works", { lg <- lagosus_load("locus") expect_equal( - display_names(names(lg$locus$locus_information))[22], + display_names(names(lg$locus$lake_information))[22], "ID (ws)") }) diff --git a/tests/testthat/test-lagos_load.R b/tests/testthat/test-lagos_load.R index 9eefe82..317f066 100644 --- a/tests/testthat/test-lagos_load.R +++ b/tests/testthat/test-lagos_load.R @@ -16,7 +16,7 @@ test_that("reachcodes have non-scientific notation", { skip_on_cran() skip_on_ci() - lakes_limno <- lagosus_load("locus")$locus$locus_information + lakes_limno <- lagosus_load("locus")$locus$lake_information expect_gt( nchar(lakes_limno[lakes_limno$lagoslakeid == 448,]$lake_reachcode), 12)# [1] nchar("4.51733E+12") diff --git a/tests/testthat/test-query_lagos_names.R b/tests/testthat/test-query_lagos_names.R index 20624d1..9a413de 100644 --- a/tests/testthat/test-query_lagos_names.R +++ b/tests/testthat/test-query_lagos_names.R @@ -6,6 +6,6 @@ test_that("query_lagos_names works", { dt <- readRDS("lagos_test_subset.rds") expect_equal( query_lagos_names("namegnis", dt = dt), - c("locus_link", "locus_information")) + c("lake_link", "lake_information")) })