Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

epu_sf documentation #45

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Encoding: UTF-8
Roxygen: list(markdown = TRUE)
RoxygenNote: 7.2.3
Depends:
R (>= 2.10)
R (>= 3.5.0)
Imports:
sf,
raster
Expand Down
22 changes: 22 additions & 0 deletions R/data_epu_sf.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#' Ecological Production Units
#'
#' An sf object containing the Northeast US shelf Ecological Production Units (EPUs).
#' Ecological Production Units (EPUs) delineate regions unique in physiographic, oceanographic and biotic aspects on the Northeast U.S. Continental Shelf, representing an area of approximately 264,000 km within the 200 m isobath. There are four EPUs on the Shelf, including the Mid-Atlantic Bight (MAB), Georges Bank (GB), Gulf of Maine (GOM), and Scotian Shelf (SS). The Scotian Shelf lies outside the management domain of US Fishery Management Councils and is generally not considered in State of the Ecosystem Reports.
#'
#' @format A data frame/ \code{sf} object
#' \describe{
#' \item{Geometry type}{MULTIPOLYGON}
#' \item{Dimension}{XY}
#' \item{Bounding box}{xmin: -77 ymin: 35.8327 xmax: -65.66667 ymax: 44.66667}
#' \item{Geodetic CRS}{ +proj=longlat +lat_0=40 +lon_0=-77+x_0=0 +y_0=0 +datum=NAD83 +no_defs +ellps=GRS80 +towgs84=0,0,0}
#' \item{Features}{4 x 3}
#' \item{Metadata}{See source}
#' }
#'
#'
#' @docType data
#' @name epu_sf
#' @usage data("epu_sf")
#' @keywords datasets
#' @source \url{https://noaa-edab.github.io/tech-doc/epu.html}
NULL
6 changes: 3 additions & 3 deletions data-raw/get_epu_sf.R
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ gis.dir <- here::here('data-raw','gis')
get_epu_sf <- function(save_clean){
crs <- "+proj=longlat +lat_1=35 +lat_2=45 +lat_0=40 +lon_0=-77+x_0=0
+y_0=0 +datum=NAD83 +no_defs +ellps=GRS80 +towgs84=0,0,0"
epu_shp <- rgdal::readOGR(file.path(gis.dir, "EPU_Extended.shp"), verbose = F)
raster::crs(epu_shp) <- crs
epu_shp <- sf::st_as_sf(rgdal::readOGR(file.path(gis.dir, "EPU_Extended.shp"), verbose = F))
sf::st_crs(epu_shp) <- crs
epu_sf <- as(epu_shp, "sf")

if (save_clean){
usethis::use_data(epu_sf)
usethis::use_data(epu_sf, overwrite = TRUE)
} else {
return(epu_sf)
}
Expand Down
Binary file modified data/epu_sf.rda
Binary file not shown.
28 changes: 28 additions & 0 deletions man/epu_sf.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions pkgdown/_pkgdown.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ reference:
- starts_with("NAFO_")
- "final_mass_inshore_stat"
- "Herring_Management_Areas"
- "epu_sf"
- title: Closed Areas
desc: Areas in which fishing is restricted
- contents:
Expand Down