diff --git a/BirdFlowModels.Rproj b/BirdFlowModels.Rproj index 69fafd4..5eaa06c 100644 --- a/BirdFlowModels.Rproj +++ b/BirdFlowModels.Rproj @@ -1,4 +1,5 @@ Version: 1.0 +ProjectId: 6c1bf7fa-d9e4-4350-ab6d-87452de7717f RestoreWorkspace: No SaveWorkspace: No diff --git a/DESCRIPTION b/DESCRIPTION index 2cf3498..98aff18 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: BirdFlowModels Title: Data package with example BirdFlowR models -Version: 0.0.2.9002 +Version: 0.0.2.9003 Authors@R: person("Ethan", "Plunkett", email = "plunkett@umass.edu", role = c("aut", "cre"), @@ -14,7 +14,7 @@ LazyData: true LazyDataCompression: gzip Encoding: UTF-8 Roxygen: list(markdown = TRUE) -RoxygenNote: 7.2.3 +RoxygenNote: 7.3.2 Depends: R (>= 3.5) Imports: diff --git a/NEWS.md b/NEWS.md index b6ffcc6..1ac3e26 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,3 +1,8 @@ +## BirdFlowModels 0.0.2.9003 +2025-04-08 + +* Added `states` with state boundaries as an `sf` object. + ## BirdFlowModels 0.0.2.9002 2023-04-12 diff --git a/R/data.R b/R/data.R index 7ca6494..4336149 100644 --- a/R/data.R +++ b/R/data.R @@ -49,4 +49,3 @@ #' twice in observations and once in intervals. The sub-setting was for #' demonstration not statistical reasons. "rewbla_observations" - diff --git a/R/states.R b/R/states.R new file mode 100644 index 0000000..ce7d680 --- /dev/null +++ b/R/states.R @@ -0,0 +1,35 @@ +#' Low Resolution State Boundaries +#' +#' This is a low resolution copy of the boundaries of U.S. states +#' from Natural Earth +#' +#' It is included here to make it available to a vignette in BirdFlowR +#' without adding a dependency to the **rnaturalearthhires** package. +#' +#' If you need state boundaries for anything other than a trivial example +#' please use `rnaturalearth::ne_states("United States of America")` for +#' a higher resolution version of the state boundaries. +#' +#' +#' @format *sf* object containing very coarse state boundaries this is also of +#' class **data.frame** and has columns: +#' \describe{ +#' \item{name}{State name} +#' \item{geometry}{Contains polyon information} +#' +#' The code below was used to create this object: +#' ``` +#' bf <- amewoo +#' states <- rnaturalearth::ne_states("United States of America") +#' states <- states[!states$gn_name %in% c("Alaska", "Hawaii"), ] +#' states <- sf::st_transform(states, crs(bf)) +#' +#' +#' states <- sf::st_simplify(states, preserveTopology = FALSE, +#' dTolerance = 1000) +#' states <- states[ , names(states) %in% c("name", "geometry")] +#' ``` +#' +#' } +#' @source +"states" diff --git a/README.md b/README.md index ad39747..6cd9b40 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ That is used for most testing and vignette code. It has not been vetted for scientific use. A second model `rewbla` and a random subset of a banding dataset is used for -testing log likelihood functions. It is also not vetted for sceintific use. +testing log likelihood functions. It is also not vetted for scientific use. Inclusion of these species here should not be taken as indication that we will develop fully vetted models for these species, or that they will always be diff --git a/data-raw/DATASET.R b/data-raw/DATASET.R index 75ba97e..030a0c1 100644 --- a/data-raw/DATASET.R +++ b/data-raw/DATASET.R @@ -43,5 +43,3 @@ str(rewbla$dates) # resave save(rewbla, file = rewbla_rda_file, compress = original_compression) - - diff --git a/data-raw/states.R b/data-raw/states.R new file mode 100644 index 0000000..18e75e5 --- /dev/null +++ b/data-raw/states.R @@ -0,0 +1,19 @@ +library(BirdFlowR) +bf <- amewoo +states <- rnaturalearth::ne_states("United States of America") +states <- states[!states$gn_name %in% c("Alaska", "Hawaii"), ] +states <- sf::st_transform(states, crs(bf)) + + +states <- sf::st_simplify(states, preserveTopology = FALSE, + dTolerance = 1000) +states <- states[, names(states) %in% c("name", "geometry")] + +if (FALSE) { + # Evaluate how simplified and object size + plot(states[, "geometry"]) + object.size(states) |> format(units = "Mb") +} + + +usethis::use_data(states, overwrite = TRUE) diff --git a/data/states.rda b/data/states.rda new file mode 100644 index 0000000..d5bf756 Binary files /dev/null and b/data/states.rda differ diff --git a/inst/WORDLIST b/inst/WORDLIST new file mode 100644 index 0000000..f53185c --- /dev/null +++ b/inst/WORDLIST @@ -0,0 +1,26 @@ +Auer +BSM +BirdFlow +BirdFlowR +Birdflow +CMD +Celis +Hochachka +Jaromczyk +Ligocki +Mackey +Malorodova +Nakash +Rodewald +Strimas +birdflow +doi +eBird +ebirdst +github +https +natively +preprocessed +rewbla +rnaturalearthhires + diff --git a/man/states.Rd b/man/states.Rd new file mode 100644 index 0000000..cedddd9 --- /dev/null +++ b/man/states.Rd @@ -0,0 +1,47 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/states.R +\docType{data} +\name{states} +\alias{states} +\title{Low Resolution State Boundaries} +\format{ +\emph{sf} object containing very coarse state boundaries this is also of +class \strong{data.frame} and has columns: +\describe{ +\item{name}{State name} +\item{geometry}{Contains polyon information} + +The code below was used to create this object: + +\if{html}{\out{
}}\preformatted{bf <- amewoo +states <- rnaturalearth::ne_states("United States of America") +states <- states[!states$gn_name \%in\% c("Alaska", "Hawaii"), ] +states <- sf::st_transform(states, crs(bf)) + + +states <- sf::st_simplify(states, preserveTopology = FALSE, + dTolerance = 1000) +states <- states[ , names(states) \%in\% c("name", "geometry")] +}\if{html}{\out{
}} + +} +} +\source{ +\url{https://www.naturalearthdata.com} +} +\usage{ +states +} +\description{ +This is a low resolution copy of the boundaries of U.S. states +from Natural Earth +} +\details{ +It is included here to make it available to a vignette in BirdFlowR +without adding a dependency to the \strong{rnaturalearthhires} package. + +If you need state boundaries for anything other than a trivial example +please use \code{rnaturalearth::ne_states("United States of America")} for +a higher resolution version of the state boundaries. +} +\keyword{datasets}