Skip to content

Add low resolution state boundaries #6

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

Merged
merged 1 commit into from
Apr 8, 2025
Merged
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
1 change: 1 addition & 0 deletions BirdFlowModels.Rproj
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
Version: 1.0
ProjectId: 6c1bf7fa-d9e4-4350-ab6d-87452de7717f

RestoreWorkspace: No
SaveWorkspace: No
Expand Down
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -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 = "[email protected]",
role = c("aut", "cre"),
Expand All @@ -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:
Expand Down
5 changes: 5 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -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

Expand Down
1 change: 0 additions & 1 deletion R/data.R
Original file line number Diff line number Diff line change
Expand Up @@ -49,4 +49,3 @@
#' twice in observations and once in intervals. The sub-setting was for
#' demonstration not statistical reasons.
"rewbla_observations"

35 changes: 35 additions & 0 deletions R/states.R
Original file line number Diff line number Diff line change
@@ -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 <https://www.naturalearthdata.com>
"states"
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 0 additions & 2 deletions data-raw/DATASET.R
Original file line number Diff line number Diff line change
Expand Up @@ -43,5 +43,3 @@ str(rewbla$dates)

# resave
save(rewbla, file = rewbla_rda_file, compress = original_compression)


19 changes: 19 additions & 0 deletions data-raw/states.R
Original file line number Diff line number Diff line change
@@ -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)
Binary file added data/states.rda
Binary file not shown.
26 changes: 26 additions & 0 deletions inst/WORDLIST
Original file line number Diff line number Diff line change
@@ -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

47 changes: 47 additions & 0 deletions man/states.Rd

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