From df6042030bca01726ea08a76880f8c2d8f9bbdb4 Mon Sep 17 00:00:00 2001 From: ecknight Date: Mon, 16 Oct 2023 16:20:26 -0600 Subject: [PATCH 1/2] Species list filter bug on wt_qpad_offsets --- R/convenience-functions.R | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/R/convenience-functions.R b/R/convenience-functions.R index 8d256f0..b20ef4e 100644 --- a/R/convenience-functions.R +++ b/R/convenience-functions.R @@ -420,7 +420,7 @@ wt_format_occupancy <- function(data, #' } #' @return An object of class unmarkedFrameOccu. See `unmarked::unmarkedFrameOccu` for details. -wt_qpad_offsets <- function(data, species = "all", version = 3, together=TRUE){ +wt_qpad_offsets <- function(data, species = c("all"), version = 3, together=TRUE){ #Make prediction object cat("Extracting covariates for offset calculation - be patient") @@ -431,7 +431,7 @@ wt_qpad_offsets <- function(data, species = "all", version = 3, together=TRUE){ load_BAM_QPAD(version) #Make the species list - if(species=="all") spp <- sort(intersect(getBAMspecieslist(), colnames(data))) else spp <- species + if("all" %in% species) spp <- sort(intersect(getBAMspecieslist(), colnames(data))) else spp <- species #Set up the offset loop cat("\nCalculating offsets") @@ -440,7 +440,7 @@ wt_qpad_offsets <- function(data, species = "all", version = 3, together=TRUE){ #Make the offsets for (i in 1:length(spp)){ - cat(spp[i], "\n") + cat("\n", spp[i]) o <- .make_off(spp[i], x) off[,i] <- o$offset } From b4d03c951074fc64ec3a395236d74e3ae617188a Mon Sep 17 00:00:00 2001 From: ecknight Date: Tue, 17 Oct 2023 12:33:18 -0600 Subject: [PATCH 2/2] Fix wt_qpad_offsets bug --- man/wt_qpad_offsets.Rd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/man/wt_qpad_offsets.Rd b/man/wt_qpad_offsets.Rd index f8bfd08..2300e63 100644 --- a/man/wt_qpad_offsets.Rd +++ b/man/wt_qpad_offsets.Rd @@ -4,7 +4,7 @@ \alias{wt_qpad_offsets} \title{Get QPAD offsets} \usage{ -wt_qpad_offsets(data, species = "all", version = 3, together = TRUE) +wt_qpad_offsets(data, species = c("all"), version = 3, together = TRUE) } \arguments{ \item{data}{Dataframe output from the \code{wt_make_wide()} function.}