Skip to content

Commit

Permalink
Merge pull request #182 from birdflow-science/fix-collection-index
Browse files Browse the repository at this point in the history
fix bug in example data for rmarkdwon collection index
  • Loading branch information
ethanplunkett committed May 15, 2024
2 parents dddb54d + 4378ffc commit c99704a
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 10 deletions.
6 changes: 4 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
5 changes: 5 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
6 changes: 3 additions & 3 deletions R/animate_distr.R
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@
#' anim <- animate_distr(distr, bf, show_dynamic_mask = TRUE)
#'
#' \dontrun{
#' # Display it
#' anim
#' # Display it
#' anim
#' }
#' ### Project a distribution
#'
Expand Down Expand Up @@ -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, ...)
Expand Down
Binary file modified inst/markdown_templates/index_example.Rds
Binary file not shown.
6 changes: 3 additions & 3 deletions man/animate_distr.Rd

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

8 changes: 6 additions & 2 deletions tests/testthat/test-as_distr.R
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit c99704a

Please sign in to comment.