diff --git a/DESCRIPTION b/DESCRIPTION index 774b6d59..6ae48230 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -3,12 +3,14 @@ Title: Predict and Visualize Bird Movement Version: 0.1.0.9056 Authors@R: c(person("Ethan", "Plunkett", email = "plunkett@umass.edu", role = c("aut", "cre"), - comment = c(ORCID = "0000-0003-4405-2251"))) + comment = c(ORCID = "0000-0003-4405-2251")), + person("BirdFlow-Science", role = "cph"), + person("National Science Foundation", role = "fnd")) Description: BirdFlowR predicts bird movement and distribution from previously fitted models. License: MIT + file LICENSE Encoding: UTF-8 Roxygen: list(markdown = TRUE) -RoxygenNote: 7.2.3 +RoxygenNote: 7.3.1 Suggests: BirdFlowModels (>= 0.0.2.9002), covr, diff --git a/NEWS.md b/NEWS.md index 6c5d1b45..ca4fceaa 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,3 +1,8 @@ +# Birdflow 0.1.0.9058 +2024-05-07 + +* Fixed bug that prevented knitting example collection index without passed +parameters. # Birdflow 0.1.0.9057 2024-04-17 diff --git a/R/animate_distr.R b/R/animate_distr.R index f1e896de..b0163168 100644 --- a/R/animate_distr.R +++ b/R/animate_distr.R @@ -28,8 +28,8 @@ #' anim <- animate_distr(distr, bf, show_dynamic_mask = TRUE) #' #' \dontrun{ -#' # Display it -#' anim +#' # Display it +#' anim #' } #' ### Project a distribution #' @@ -65,7 +65,7 @@ #' gif_file <- tempfile("animation", fileext = ".gif") #' gganimate::save_animation(gif, gif_file) #' file.remove(gif_file) # cleanup -#' } +#' } animate_distr <- function(distr, bf, title = species(bf), ...) { p <- plot_distr(distr, bf, ...) diff --git a/inst/markdown_templates/index_example.Rds b/inst/markdown_templates/index_example.Rds index 5a1c1ebf..36342d9b 100644 Binary files a/inst/markdown_templates/index_example.Rds and b/inst/markdown_templates/index_example.Rds differ diff --git a/man/animate_distr.Rd b/man/animate_distr.Rd index c78dcc24..a8fecfed 100644 --- a/man/animate_distr.Rd +++ b/man/animate_distr.Rd @@ -82,8 +82,8 @@ distr <- get_distr(bf, ts) anim <- animate_distr(distr, bf, show_dynamic_mask = TRUE) \dontrun{ -# Display it -anim + # Display it + anim } ### Project a distribution @@ -119,5 +119,5 @@ spread_anim <- animate_distr(density_spread, bf, limit = c(0, 0.05)) gif_file <- tempfile("animation", fileext = ".gif") gganimate::save_animation(gif, gif_file) file.remove(gif_file) # cleanup - } +} } diff --git a/tests/testthat/test-as_distr.R b/tests/testthat/test-as_distr.R index 3eb0c354..ba311088 100644 --- a/tests/testthat/test-as_distr.R +++ b/tests/testthat/test-as_distr.R @@ -55,10 +55,14 @@ test_that("as_distr works with raster objects", { expect_warning(d <- as_distr(r, bf)) # value lost both to cropping and masking expect_equal(sum(d), 1) - # Multiple layers + # Multiple layers in raster r2 <- c(r, r, r) expect_warning(d2 <- as_distr(r2, bf)) # value lost to cropping and masking - expect_true(all(apply(d2, 2, sum) == 1)) + sums <- apply(d2, 2, sum) + for(i in seq_along(sums)) { + expect_equal(sums[i], 1) + } + expect_equal(nrow(d2), n_active(bf)) expect_equal(ncol(d2), 3) expect_equal(d2[, 1], d, ignore_attr = TRUE)