From 2b744db8fbdadf88b25262fbe6d9c91d63d29e2b Mon Sep 17 00:00:00 2001 From: Laura Marshall Date: Thu, 27 Mar 2025 14:15:20 +0000 Subject: [PATCH 01/16] Add citations to dht.se #115 --- DESCRIPTION | 4 ++- NAMESPACE | 1 + R/dht.se.R | 30 ++++++++++--------- inst/REFERENCES.bib | 70 +++++++++++++++++++++++++++++++++++++++++++++ man/dht.se.Rd | 28 +++++++++--------- 5 files changed, 104 insertions(+), 29 deletions(-) create mode 100644 inst/REFERENCES.bib diff --git a/DESCRIPTION b/DESCRIPTION index 9cfb92b0..e7725001 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -29,7 +29,8 @@ Imports: methods, numDeriv, nloptr, - Rsolnp + Rsolnp, + Rdpack Suggests: Distance, testthat, @@ -38,4 +39,5 @@ Suggests: rmarkdown, bookdown RoxygenNote: 7.3.2 +RdMacros: Rdpack Encoding: UTF-8 diff --git a/NAMESPACE b/NAMESPACE index 507a4dc3..25f8a9e3 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -72,6 +72,7 @@ import(Rsolnp) import(mgcv) import(nloptr) import(optimx) +importFrom(Rdpack,reprompt) importFrom(grDevices,dev.interactive) importFrom(grDevices,dev.new) importFrom(grDevices,devAskNewPage) diff --git a/R/dht.se.R b/R/dht.se.R index d467e2a7..024ba86c 100644 --- a/R/dht.se.R +++ b/R/dht.se.R @@ -12,7 +12,7 @@ #' \item variation in abundance due to random sample selection; #' } #' The first component (model parameter uncertainty) is computed using a delta -#' method estimate of variance (Huggins 1989, 1991, Borchers et al. 1998) in +#' method estimate of variance (\insertCite{huggins1989;nobrackets}{mrds}; \insertCite{huggins1991;nobrackets}{mrds}; \insertCite{borchers1998;nobrackets}{mrds}) in #' which the first derivatives of the abundance estimator with respect to the #' parameters in the detection function are computed numerically (see #' \code{\link{DeltaMethod}}). @@ -22,18 +22,18 @@ #' estimator used. To begin with there three possible values for \code{varflag} #' to calculate encounter rate: #' \itemize{ -#' \item \code{0} uses a binomial variance for the number of observations -#' (equation 13 of Borchers et al. 1998). This estimator is only useful if the -#' sampled region is the survey region and the objects are not clustered; this -#' situation will not occur very often; +#' \item \code{0} uses a binomial variance for the number of +#' observations (equation 13 of \insertCite{borchers1998;nobrackets}{mrds}). This estimator is only +#' useful if the sampled region is the survey region and the objects are not +#' clustered; this situation will not occur very often; #' \item \code{1} uses the encounter rate \eqn{n/L} (objects observed per unit -#' transect) from Buckland et al. (2001) pg 78-79 (equation 3.78) for line -#' transects (see also Fewster et al, 2009 estimator R2). This variance +#' transect) from \insertCite{buckland2001;textual}{mrds} pg 78-79 (equation 3.78) for line +#' transects (see also \insertCite{fewster2009;nobrackets}{mrds} estimator R2). This variance #' estimator is not appropriate if \code{size} or a derivative of \code{size} #' is used in the detection function; #' \item \code{2} is the default and uses the encounter rate estimator -#' \eqn{\hat{N}/L} (estimated abundance per unit transect) suggested by Innes -#' et al (2002) and Marques & Buckland (2004). +#' \eqn{\hat{N}/L} (estimated abundance per unit transect) suggested by +#' \insertCite{innes2002;textual}{mrds} and \insertCite{marques2004;textual}{mrds} #' } #' #' In general if any covariates are used in the models, the default @@ -42,21 +42,21 @@ #' the mean group size and standard error is also reported. #' #' For options \code{1} and \code{2}, it is then possible to choose one of the -#' estimator forms given in Fewster et al (2009). For line transects: +#' estimator forms given in \insertCite{fewster2009;textual}{mrds}. For line transects: #' \code{"R2"}, \code{"R3"}, \code{"R4"}, \code{"S1"}, \code{"S2"}, #' \code{"O1"}, \code{"O2"} or \code{"O3"} can be used by specifying the #' \code{ervar=} option (default \code{"R2"}). For points, either the #' \code{"P2"} or \code{"P3"} estimator can be selected (>=mrds 2.3.0 #' default \code{"P2"}, <= mrds 2.2.9 default \code{"P3"}). See -#' \code{\link{varn}} and Fewster et al (2009) for further details -#' on these estimators. +#' \code{\link{varn}} and \insertCite{fewster2009;textual}{mrds} +#' for further details on these estimators. #' #' Exceptions to the above occur if there is only one sample in a stratum. In #' that case it uses Poisson assumption (\eqn{Var(x)=x}) and it assumes a known #' variance so \eqn{z=1.96} is used for critical value. In all other cases the #' degrees of freedom for the \eqn{t}-distribution assumed for the #' log(abundance) or log(density) is based on the Satterthwaite approximation -#' (Buckland et al. 2001 pg 90) for the degrees of freedom (df). The df are +#' (\insertCite{buckland2001;nobrackets}{mrds} pg 90) for the degrees of freedom (df). The df are #' weighted by the squared cv in combining the two sources of variation because #' of the assumed log-normal distribution because the components are #' multiplicative. For combining df for the sampling variance across regions @@ -84,9 +84,11 @@ #' their own code. #' @author Jeff Laake #' @seealso \code{\link{dht}}, \code{\link{print.dht}} -#' @references see \code{\link{dht}} +#' @references +#' \insertAllCited{} #' @keywords utility #' @importFrom stats qnorm qt var +#' @importFrom Rdpack reprompt dht.se <- function(model, region.table, samples, obs, options, numRegions, estimate.table, Nhat.by.sample){ # Functions Used: DeltaMethod, dht.deriv (in DeltaMethod), varn diff --git a/inst/REFERENCES.bib b/inst/REFERENCES.bib new file mode 100644 index 00000000..c35d196d --- /dev/null +++ b/inst/REFERENCES.bib @@ -0,0 +1,70 @@ +@article{borchers1998, + author = {Borchers, D. L. and Buckland, S. T. and Goedhart, P. W. and Clarke, E. D. and Hedley, S. L.}, + title = {Horvitz-Thompson Estimators for Double-Platform Line Transect Surveys}, + journal = {Biometrics}, + year = {1998}, + volume = {54}, + number = {4}, + pages = {1221-1237}, + doi = {10.2307/253365} +} + +@book{buckland2001, + title={Introduction to distance sampling: estimating abundance of biological populations}, + author={Buckland, S. T. and Anderson, D. R. and Burnham, K. P. and Laake, J. L. and Borchers, D. L. and Thomas, L.}, + year={2001}, + publisher={Oxford university press} +} + +@article{fewster2009, + title={Estimating the encounter rate variance in distance sampling}, + author={Fewster, R. M. and Buckland, S. T. and Burnham, K. P. and Borchers, D. L. and Jupp, P. E. and Laake, J. L. and Thomas, L.}, + journal={Biometrics}, + volume={65}, + number={1}, + pages={225-236}, + year={2009}, + publisher={Oxford University Press} +} + +@article{huggins1989, + author = {Huggins, R. M.}, + title = {On the statistical analysis of capture experiments}, + journal = {Biometrika}, + year = {1989}, + volume = {76}, + number = {1}, + pages = {133-140}, + doi = {10.1093/biomet/76.1.133} +} + +@article{huggins1991, + author = {Huggins, R. M.}, + title = {Some practical aspects of a conditional likelihood approach to capture experiments}, + journal = {Biometrics}, + year = {1991}, + volume = {47}, + number = {1}, + pages = {725-732}, + doi = {10.1093/biomet/76.1.133} +} + +@article{innes2002, + title={Surveys of belugas and narwhals in the Canadian High Arctic in 1996}, + author={Innes, Stuart and Heide-J{\o}rgensen, MP and Laake, Jeff L and Laidre, Kristin L and Cleator, Holly J and Richard, Pierre and Stewart, Robert EA}, + journal={NAMMCO Scientific Publications}, + volume={4}, + pages={169-190}, + year={2002} +} + +@inbook{marques2004, + author = {Marques, F. F. C. and Buckland, S. T.}, + title = {Advanced distance sampling}, + chapter = {Covariate models for the detection function}, + pages = {31-47}, + year = {2004}, + publisher = {Oxford University Press} +} + + diff --git a/man/dht.se.Rd b/man/dht.se.Rd index 8050e56e..93cf77af 100644 --- a/man/dht.se.Rd +++ b/man/dht.se.Rd @@ -50,7 +50,7 @@ The variance has two components: \item variation in abundance due to random sample selection; } The first component (model parameter uncertainty) is computed using a delta -method estimate of variance (Huggins 1989, 1991, Borchers et al. 1998) in +method estimate of variance (\insertCite{huggins1989;nobrackets}{mrds}; \insertCite{huggins1991;nobrackets}{mrds}; \insertCite{borchers1998;nobrackets}{mrds}) in which the first derivatives of the abundance estimator with respect to the parameters in the detection function are computed numerically (see \code{\link{DeltaMethod}}). @@ -60,18 +60,18 @@ several ways depending on the form taken for the encounter rate and the estimator used. To begin with there three possible values for \code{varflag} to calculate encounter rate: \itemize{ - \item \code{0} uses a binomial variance for the number of observations - (equation 13 of Borchers et al. 1998). This estimator is only useful if the - sampled region is the survey region and the objects are not clustered; this - situation will not occur very often; + \item \code{0} uses a binomial variance for the number of + observations (equation 13 of \insertCite{borchers1998;nobrackets}{mrds}). This estimator is only + useful if the sampled region is the survey region and the objects are not + clustered; this situation will not occur very often; \item \code{1} uses the encounter rate \eqn{n/L} (objects observed per unit - transect) from Buckland et al. (2001) pg 78-79 (equation 3.78) for line - transects (see also Fewster et al, 2009 estimator R2). This variance + transect) from \insertCite{buckland2001;textual}{mrds} pg 78-79 (equation 3.78) for line + transects (see also \insertCite{fewster2009;nobrackets}{mrds} estimator R2). This variance estimator is not appropriate if \code{size} or a derivative of \code{size} is used in the detection function; \item \code{2} is the default and uses the encounter rate estimator - \eqn{\hat{N}/L} (estimated abundance per unit transect) suggested by Innes - et al (2002) and Marques & Buckland (2004). + \eqn{\hat{N}/L} (estimated abundance per unit transect) suggested by + \insertCite{innes2002;textual}{mrds} and \insertCite{marques2004;textual}{mrds} } In general if any covariates are used in the models, the default @@ -80,21 +80,21 @@ account variability due to covariate effects. If the population is clustered the mean group size and standard error is also reported. For options \code{1} and \code{2}, it is then possible to choose one of the -estimator forms given in Fewster et al (2009). For line transects: +estimator forms given in \insertCite{fewster2009;textual}{mrds}. For line transects: \code{"R2"}, \code{"R3"}, \code{"R4"}, \code{"S1"}, \code{"S2"}, \code{"O1"}, \code{"O2"} or \code{"O3"} can be used by specifying the \code{ervar=} option (default \code{"R2"}). For points, either the \code{"P2"} or \code{"P3"} estimator can be selected (>=mrds 2.3.0 default \code{"P2"}, <= mrds 2.2.9 default \code{"P3"}). See -\code{\link{varn}} and Fewster et al (2009) for further details -on these estimators. +\code{\link{varn}} and \insertCite{fewster2009;textual}{mrds} + for further details on these estimators. Exceptions to the above occur if there is only one sample in a stratum. In that case it uses Poisson assumption (\eqn{Var(x)=x}) and it assumes a known variance so \eqn{z=1.96} is used for critical value. In all other cases the degrees of freedom for the \eqn{t}-distribution assumed for the log(abundance) or log(density) is based on the Satterthwaite approximation -(Buckland et al. 2001 pg 90) for the degrees of freedom (df). The df are +(\insertCite{buckland2001;nobrackets}{mrds} pg 90) for the degrees of freedom (df). The df are weighted by the squared cv in combining the two sources of variation because of the assumed log-normal distribution because the components are multiplicative. For combining df for the sampling variance across regions @@ -112,7 +112,7 @@ completeness and for anyone expanding the code or using this function in their own code. } \references{ -see \code{\link{dht}} +\insertAllCited{} } \seealso{ \code{\link{dht}}, \code{\link{print.dht}} From 1a0182c366c6d138503f01698c1c0e9d7fe6da4b Mon Sep 17 00:00:00 2001 From: Laura Marshall Date: Thu, 27 Mar 2025 14:23:37 +0000 Subject: [PATCH 02/16] Updated the dht.se description @lenthomas can you please check this reference #115 --- R/dht.se.R | 11 +++++++---- man/dht.se.Rd | 11 +++++++---- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/R/dht.se.R b/R/dht.se.R index 024ba86c..d2038813 100644 --- a/R/dht.se.R +++ b/R/dht.se.R @@ -22,7 +22,7 @@ #' estimator used. To begin with there three possible values for \code{varflag} #' to calculate encounter rate: #' \itemize{ -#' \item \code{0} uses a binomial variance for the number of +#' \item \code{0} uses a negative binomial variance for the number of #' observations (equation 13 of \insertCite{borchers1998;nobrackets}{mrds}). This estimator is only #' useful if the sampled region is the survey region and the objects are not #' clustered; this situation will not occur very often; @@ -52,9 +52,12 @@ #' for further details on these estimators. #' #' Exceptions to the above occur if there is only one sample in a stratum. In -#' that case it uses Poisson assumption (\eqn{Var(x)=x}) and it assumes a known -#' variance so \eqn{z=1.96} is used for critical value. In all other cases the -#' degrees of freedom for the \eqn{t}-distribution assumed for the +#' this situation, \code{varflag=0} continues to use a negative binomial +#' variance while the other options assume a Poisson variance (\eqn{Var(x)=x}), +#' where when \code{varflag=1} x is number of detections in the covered region and +#' when \code{varflag=2} x is the abundance in the covered region. It also assumes +#' a known variance so \eqn{z=1.96} is used for critical value. In all other cases +#' the degrees of freedom for the \eqn{t}-distribution assumed for the #' log(abundance) or log(density) is based on the Satterthwaite approximation #' (\insertCite{buckland2001;nobrackets}{mrds} pg 90) for the degrees of freedom (df). The df are #' weighted by the squared cv in combining the two sources of variation because diff --git a/man/dht.se.Rd b/man/dht.se.Rd index 93cf77af..b605a949 100644 --- a/man/dht.se.Rd +++ b/man/dht.se.Rd @@ -60,7 +60,7 @@ several ways depending on the form taken for the encounter rate and the estimator used. To begin with there three possible values for \code{varflag} to calculate encounter rate: \itemize{ - \item \code{0} uses a binomial variance for the number of + \item \code{0} uses a negative binomial variance for the number of observations (equation 13 of \insertCite{borchers1998;nobrackets}{mrds}). This estimator is only useful if the sampled region is the survey region and the objects are not clustered; this situation will not occur very often; @@ -90,9 +90,12 @@ default \code{"P2"}, <= mrds 2.2.9 default \code{"P3"}). See for further details on these estimators. Exceptions to the above occur if there is only one sample in a stratum. In -that case it uses Poisson assumption (\eqn{Var(x)=x}) and it assumes a known -variance so \eqn{z=1.96} is used for critical value. In all other cases the -degrees of freedom for the \eqn{t}-distribution assumed for the +this situation, \code{varflag=0} continues to use a negative binomial +variance while the other options assume a Poisson variance (\eqn{Var(x)=x}), +where when \code{varflag=1} x is number of detections in the covered region and +when \code{varflag=2} x is the abundance in the covered region. It also assumes +a known variance so \eqn{z=1.96} is used for critical value. In all other cases +the degrees of freedom for the \eqn{t}-distribution assumed for the log(abundance) or log(density) is based on the Satterthwaite approximation (\insertCite{buckland2001;nobrackets}{mrds} pg 90) for the degrees of freedom (df). The df are weighted by the squared cv in combining the two sources of variation because From b4064d0ea19e673001023bb40c78aaf933f180fb Mon Sep 17 00:00:00 2001 From: Laura Marshall Date: Fri, 28 Mar 2025 14:56:48 +0000 Subject: [PATCH 03/16] Single sample warnings Issue warnings to the user when there is only a single sample in a region or one or more strata. Reference issue #115 --- R/dht.R | 22 +++++++++ R/dht.se.R | 12 +++-- man/dht.se.Rd | 3 +- tests/testthat/test_dht.R | 75 +++++++++++++++++++++++++++++++ tests/testthat/test_nosightings.R | 4 +- 5 files changed, 110 insertions(+), 6 deletions(-) diff --git a/R/dht.R b/R/dht.R index 89bcbd07..1946eee2 100644 --- a/R/dht.R +++ b/R/dht.R @@ -626,6 +626,28 @@ dht <- function(model, region.table, sample.table, obs.table=NULL, subset=NULL, } result <- list(individuals=individuals) } + + # Check to see if need to issue user with a warning if there were any strata with only one sample. + if(any(result$individuals$summary$k == 1)){ + # if there is only one strata + if(nrow(result$individuals$summary) == 1){ + if(options$varflag == 1){ + warning("Only one sample, assuming variance of n is Poisson. See help on dht.se for recommendations.", immediate. = TRUE, call. = FALSE) + }else if(options$varflag == 2){ + warning("Only one sample, assuming abundance in the covered region is Poisson. See help on dht.se for recommendations.", immediate. = TRUE, call. = FALSE) + } + }else{ + # if there are multiple strata + # find which strata have only one sample + strat.names <- result$individuals$summary$Region[result$individuals$summary$k == 1] + strat.txt <- ifelse(length(strat.names) > 1, ". For these strata, ", ". For this stratum, ") + if(options$varflag == 1){ + warning(paste("Only one sample in the following strata: ", paste(strat.names, collapse = ", "), strat.txt, "it is assumed variance of n is Poisson. See help on dht.se.", sep = ""), immediate. = TRUE, call. = FALSE) + }else if(options$varflag == 2){ + warning("Only one sample in the following strata: ", paste(strat.names, collapse = ", "), strat.txt, "it is assumed abundance in the covered region is Poisson. See help on dht.se.", immediate. = TRUE, call. = FALSE) + } + } + } # add some meta data # save enounter rate variance information diff --git a/R/dht.se.R b/R/dht.se.R index d2038813..63ee7b31 100644 --- a/R/dht.se.R +++ b/R/dht.se.R @@ -23,7 +23,8 @@ #' to calculate encounter rate: #' \itemize{ #' \item \code{0} uses a negative binomial variance for the number of -#' observations (equation 13 of \insertCite{borchers1998;nobrackets}{mrds}). This estimator is only +#' observations (equation 13 of \insertCite{borchers1998;nobrackets}{mrds}). +#' This estimator is only #' useful if the sampled region is the survey region and the objects are not #' clustered; this situation will not occur very often; #' \item \code{1} uses the encounter rate \eqn{n/L} (objects observed per unit @@ -132,8 +133,9 @@ dht.se <- function(model, region.table, samples, obs, options, numRegions, # Next compute the component due to sampling of both lines and of the # detection process itself # There are 3 different options here: - # 1) varflag=0; Binomial variance of detection process - only applicable if - # survey region=covered region although it will scale up but it would be + # 1) varflag=0; Negative binomial variance of detection process - only + # applicable if survey region=covered region although it will scale up + # but it would be # a poor estimator # 2) varflag=1; delta method, with varn based on Fewster et al (2009) # estimator R2 (var(n/L)) @@ -233,10 +235,14 @@ dht.se <- function(model, region.table, samples, obs, options, numRegions, if (options$group) vars <- 0 + # if there is only one sample assume Poisson variance if(length(stratum.data$Effort.y) == 1){ if (options$varflag == 1){ + # Assuming variance of n is Poisson: var(x) = x vc2[i] <- Ni^2 * 1/stratum.data$n }else{ + # varflag = 2 + # Assuming abundance in covered region is Poisson: var(x) = x vc2[i] <- Ni^2 * 1/Ni } }else if (options$varflag == 1){ diff --git a/man/dht.se.Rd b/man/dht.se.Rd index b605a949..b95f2fec 100644 --- a/man/dht.se.Rd +++ b/man/dht.se.Rd @@ -61,7 +61,8 @@ estimator used. To begin with there three possible values for \code{varflag} to calculate encounter rate: \itemize{ \item \code{0} uses a negative binomial variance for the number of - observations (equation 13 of \insertCite{borchers1998;nobrackets}{mrds}). This estimator is only + observations (equation 13 of \insertCite{borchers1998;nobrackets}{mrds}). + This estimator is only useful if the sampled region is the survey region and the objects are not clustered; this situation will not occur very often; \item \code{1} uses the encounter rate \eqn{n/L} (objects observed per unit diff --git a/tests/testthat/test_dht.R b/tests/testthat/test_dht.R index 8d8eef6e..202c3e83 100644 --- a/tests/testthat/test_dht.R +++ b/tests/testthat/test_dht.R @@ -83,3 +83,78 @@ test_that("dht with various opts after unif fixes", { expect_true(inherits(dht.result.io.fi, "dht")) }) + + +test_that("warning when only one sample", { + library(Distance) + data(capercaillie) + capercaillie$size <- NULL + conversion.factor <- convert_units("meter", "kilometer", "hectare") + + caper.ddf <- ddf(dsmodel = ~cds(key = "hn", formula = ~1), + data = capercaillie, + meta.data = list(width = 60)) + + dht.tables <- Distance::unflatten(capercaillie) + + caper.dht <- expect_warning(dht(caper.ddf, + region.table = dht.tables$region.table, + sample.table = dht.tables$sample.table, + obs.table = dht.tables$obs.table, + options = list(convert.units = conversion.factor)), "Only one sample, assuming abundance in the covered region is Poisson. See help on dht.se for recommendations.") + + caper.dht <- expect_warning(dht(caper.ddf, + region.table = dht.tables$region.table, + sample.table = dht.tables$sample.table, + obs.table = dht.tables$obs.table, + options = list(convert.units = conversion.factor, varflag = 1)), "Only one sample, assuming variance of n is Poisson. See help on dht.se for recommendations.") + + caper.dht <- expect_no_warning(dht(caper.ddf, + region.table = dht.tables$region.table, + sample.table = dht.tables$sample.table, + obs.table = dht.tables$obs.table, + options = list(convert.units = conversion.factor, varflag = 0))) + + # Make up a dataset so that there are multiple strata and some have only one transect + # New dataset + caper <- capercaillie + caper$Region.Label <- "Strata A" + caper2.a <- data.frame(Sample.Label = 2, Effort = 120, distance = abs(rnorm(45,0,30)), + object = NA, detected = 1, observer = 1, Region.Label = "Strata B", + Area = 1472) + caper2.b <- data.frame(Sample.Label = 3, Effort = 120, distance = abs(rnorm(45,0,30)), + object = NA, detected = 1, observer = 1, Region.Label = "Strata B", + Area = 1472) + caper2.c <- data.frame(Sample.Label = 4, Effort = 120, distance = abs(rnorm(90,0,30)), + object = NA, detected = 1, observer = 1, Region.Label = "Strata C", + Area = 1472) + caper <- rbind(caper, caper2.a, caper2.b, caper2.c) + caper$object <- 1:nrow(caper) + + # Model multi-strata data + caper2.ddf <- ddf(dsmodel = ~cds(key = "hn", formula = ~1), + data = caper, + meta.data = list(width = 60)) + dht.tables2 <- Distance::unflatten(caper) + + caper2.dht <- expect_warning(dht(caper.ddf, + region.table = dht.tables2$region.table, + sample.table = dht.tables2$sample.table, + obs.table = dht.tables2$obs.table, + options = list(convert.units = conversion.factor)), + "Only one sample in the following strata: Strata A, Strata C. For these strata, it is assumed abundance in the covered region is Poisson. See help on dht.se.") + + caper2.dht <- expect_warning(dht(caper.ddf, + region.table = dht.tables2$region.table, + sample.table = dht.tables2$sample.table, + obs.table = dht.tables2$obs.table, + options = list(convert.units = conversion.factor, varflag = 1)), + "Only one sample in the following strata: Strata A, Strata C. For these strata, it is assumed variance of n is Poisson. See help on dht.se.") + + caper2.dht <- expect_no_warning(dht(caper.ddf, + region.table = dht.tables2$region.table, + sample.table = dht.tables2$sample.table, + obs.table = dht.tables2$obs.table, + options = list(convert.units = conversion.factor, varflag = 0))) + +}) diff --git a/tests/testthat/test_nosightings.R b/tests/testthat/test_nosightings.R index 5a554d73..4fb48b34 100644 --- a/tests/testthat/test_nosightings.R +++ b/tests/testthat/test_nosightings.R @@ -17,8 +17,8 @@ test_that("a dht object with only 0's for estimates is returned", { #run analyses ddf.clusters <- ddf(method='ds', dsmodel = ~mcds(key = 'hn', formula = ~scaledtotsize), data = clusters, meta.data = list(width = 5.5)) ddf.no.clusters <- ddf(method='ds', dsmodel = ~mcds(key = 'hn', formula = ~scaledtotsize), data = no.clusters, meta.data = list(width = 5.5)) - cluster.result <- dht(ddf.clusters, region.table, sample.table, obs.table.subset) - no.cluster.result <- dht(ddf.no.clusters, region.table, sample.table, obs.table.subset) + cluster.result <- dht(ddf.clusters, region.table, sample.table, obs.table.subset, options = list(varflag = 0)) + no.cluster.result <- dht(ddf.no.clusters, region.table, sample.table, obs.table.subset, options = list(varflag = 0)) #run tests #checks there are NO results for clusters From d2b60429185d7c414d5699938e3741f0493d4b0a Mon Sep 17 00:00:00 2001 From: Laura Marshall Date: Wed, 2 Apr 2025 17:14:52 +0100 Subject: [PATCH 04/16] Fix examples link --- R/mrds-package.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R/mrds-package.R b/R/mrds-package.R index a27237d2..f57e13d0 100644 --- a/R/mrds-package.R +++ b/R/mrds-package.R @@ -14,7 +14,7 @@ #' Biometrics 62:372-378.) #' #' Examples of distance sampling analyses are available at -#' \url{http://examples.distancesampling.org/}. +#' \url{https://distancesampling.org/resources/vignettes.html}. #' #' For help with distance sampling and this package, there is a Google Group #' \url{https://groups.google.com/forum/#!forum/distance-sampling}. From 8f6a719cd806b2b1c07995326ae2a52228469526 Mon Sep 17 00:00:00 2001 From: Laura Marshall Date: Wed, 2 Apr 2025 17:17:05 +0100 Subject: [PATCH 05/16] clarifying ervar In response to a comment on Distance issue 192 --- R/dht.R | 5 +++-- R/dht.se.R | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/R/dht.R b/R/dht.R index 1946eee2..9db6272b 100644 --- a/R/dht.R +++ b/R/dht.R @@ -120,8 +120,9 @@ #' For options \code{1} and \code{2}, it is then possible to choose one of the #' estimator forms given in Fewster et al (2009) for line transects: #' \code{"R2"}, \code{"R3"}, \code{"R4"}, \code{"S1"}, \code{"S2"}, -#' \code{"O1"}, \code{"O2"} or \code{"O3"} by specifying the \code{ervar=} -#' option (default \code{"R2"}). For points, either the \code{"P2"} or +#' \code{"O1"}, \code{"O2"} or \code{"O3"} can be used by specifying \code{ervar} +#' in the list of options provided by the \code{options} argument +#' (default \code{"R2"}). For points, either the \code{"P2"} or #' \code{"P3"} estimator can be selected (>=mrds 2.3.0 default \code{"P2"}, #' <= mrds 2.2.9 default \code{"P3"}). See \code{\link{varn}} and Fewster #' et al (2009) for further details on these estimators. diff --git a/R/dht.se.R b/R/dht.se.R index 63ee7b31..819830ee 100644 --- a/R/dht.se.R +++ b/R/dht.se.R @@ -45,8 +45,9 @@ #' For options \code{1} and \code{2}, it is then possible to choose one of the #' estimator forms given in \insertCite{fewster2009;textual}{mrds}. For line transects: #' \code{"R2"}, \code{"R3"}, \code{"R4"}, \code{"S1"}, \code{"S2"}, -#' \code{"O1"}, \code{"O2"} or \code{"O3"} can be used by specifying the -#' \code{ervar=} option (default \code{"R2"}). For points, either the +#' \code{"O1"}, \code{"O2"} or \code{"O3"} can be used by specifying \code{ervar} +#' in the list of options provided by the \code{options} argument +#' (default \code{"R2"}). For points, either the #' \code{"P2"} or \code{"P3"} estimator can be selected (>=mrds 2.3.0 #' default \code{"P2"}, <= mrds 2.2.9 default \code{"P3"}). See #' \code{\link{varn}} and \insertCite{fewster2009;textual}{mrds} From 3db58c2fda238a61e49f460e3ee1d1bcd6f77abd Mon Sep 17 00:00:00 2001 From: Laura Marshall Date: Wed, 2 Apr 2025 17:17:53 +0100 Subject: [PATCH 06/16] add link tag to see also entries --- R/dht.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R/dht.R b/R/dht.R index 9db6272b..c71102ee 100644 --- a/R/dht.R +++ b/R/dht.R @@ -188,7 +188,7 @@ #'} #' #' @author Jeff Laake, David L Miller -#' @seealso print.dht dht.se +#' @seealso \code{\link{print.dht}} \code{\link{dht.se}} #' @references #' #' Borchers, D.L., S.T. Buckland, P.W. Goedhart, E.D. Clarke, and S.L. Hedley. From 0ee20dd27e2862ba0f4f70b47101bc3a92c41a03 Mon Sep 17 00:00:00 2001 From: Laura Marshall Date: Wed, 2 Apr 2025 17:18:32 +0100 Subject: [PATCH 07/16] Cleaning up citations --- R/ddf.R | 15 +++-------- R/dht.R | 55 ++++++++-------------------------------- R/mrds-package.R | 20 ++++++--------- R/varn.R | 13 +++++----- inst/REFERENCES.bib | 44 ++++++++++++++++++++++++++++++++ man/ddf.Rd | 14 +++-------- man/dht.Rd | 61 +++++++++++---------------------------------- man/dht.se.Rd | 5 ++-- man/mrds-package.Rd | 22 +++++++--------- man/varn.Rd | 12 ++++----- 10 files changed, 108 insertions(+), 153 deletions(-) diff --git a/R/ddf.R b/R/ddf.R index 856e1084..cb59d607 100644 --- a/R/ddf.R +++ b/R/ddf.R @@ -71,7 +71,7 @@ #' for the log of the scale parameter of the key function (e.g., the equivalent #' of the standard deviation in the half-normal). The variable \code{distance} #' should not be included in the formula because the scale is for distance. -#' See Marques, F.F.C. and S.T. Buckland (2004) for more details on the +#' See \insertCite{marques2004;textual}{mrds} for more details on the #' representation of the scale formula. For the hazard rate and gamma #' functions, an additional \code{shape.formula} can be specified for the model #' of the shape parameter. The default will be ~1. @@ -91,7 +91,7 @@ #' functions are \code{formula} and \code{link}. At present, only \code{glm} #' is allowed and it is restricted to \code{link=logit}. Thus, currently the #' only form for the conditional detection functions is logistic as expressed -#' in eq 6.32 of Laake and Borchers (2004). In contrast to \code{dsmodel}, the +#' in eq 6.32 of \insertCite{laake2004;textual}{mrds}. In contrast to \code{dsmodel}, the #' argument \code{formula} will typically include \code{distance} and all other #' covariates that affect detection probability. For example, #' \code{mrmodel=~glm(formula=~distance+size+sex)} constructs a conditional @@ -228,15 +228,8 @@ #' \code{\link{ddf.io.fi}}, \code{\link{ddf.trial}}, #' \code{\link{ddf.trial.fi}}, \code{\link{ddf.rem}}, \code{\link{ddf.rem.fi}}, #' \code{\link{mrds_opt}} -#' @references Laake, J.L. and D.L. Borchers. 2004. Methods for incomplete -#' detection at distance zero. In: Advanced Distance Sampling, eds. S.T. -#' Buckland, D.R.Anderson, K.P. Burnham, J.L. Laake, D.L. Borchers, and L. -#' Thomas. Oxford University Press. -#' -#' Marques, F.F.C. and S.T. Buckland. 2004. Covariate models for the detection -#' function. In: Advanced Distance Sampling, eds. S.T. Buckland, -#' D.R.Anderson, K.P. Burnham, J.L. Laake, D.L. Borchers, and L. Thomas. -#' Oxford University Press. +#' @references +#' \insertAllCited{} #' @keywords ~Statistical Models #' @examples #' # load data diff --git a/R/dht.R b/R/dht.R index c71102ee..691bb752 100644 --- a/R/dht.R +++ b/R/dht.R @@ -10,8 +10,7 @@ #' samples within any regional stratification. For clustered populations, #' \eqn{E(s)} and its standard error are also output. #' -#' Abundance is estimated with a Horvitz-Thompson-like estimator (Huggins 1989, -#' 1991; Borchers et al 1998; Borchers and Burnham 2004). The abundance in the +#' Abundance is estimated with a Horvitz-Thompson-like estimator (\insertCite{huggins1989;nobrackets}{mrds}; \insertCite{huggins1991;nobrackets}{mrds}; \insertCite{borchers1998;nobrackets}{mrds}; \insertCite{borchers2004;nobrackets}{mrds}). The abundance in the #' sampled region is simply \eqn{1/p_1 + 1/p_2 + ... + 1/p_n} where \eqn{p_i} #' is the estimated detection probability for the \eqn{i}th detection of #' \eqn{n} total observations. It is not strictly a Horvitz-Thompson estimator @@ -78,7 +77,7 @@ #' If the argument \code{se=TRUE}, standard errors for density and abundance is #' computed. Coefficient of variation and log-normal confidence intervals are #' constructed using a Satterthwaite approximation for degrees of freedom -#' (Buckland et al. 2001 p. 90). The function \code{\link{dht.se}} computes the +#' (\insertCite{buckland2001;nobrackets}{mrds} p 90). The function \code{\link{dht.se}} computes the #' variance and interval estimates. #' #' The variance has two components: @@ -88,7 +87,7 @@ #' \item variation in abundance due to random sample selection; #' } #' The first component (model parameter uncertainty) is computed using a delta -#' method estimate of variance (Huggins 1989, 1991, Borchers et al. 1998) in +#' method estimate of variance (\insertCite{huggins1989;nobrackets}{mrds}; \insertCite{huggins1991;nobrackets}{mrds}; \insertCite{borchers1998;nobrackets}{mrds}) in #' which the first derivatives of the abundance estimator with respect to the #' parameters in the detection function are computed numerically (see #' \code{\link{DeltaMethod}}). @@ -99,17 +98,16 @@ #' to calculate encounter rate: #' \itemize{ #' \item \code{0} uses a binomial variance for the number of observations -#' (equation 13 of Borchers et al. 1998). This estimator is only useful if the +#' (equation 13 of \insertCite{borchers1998;nobrackets}{mrds}. This estimator is only useful if the #' sampled region is the survey region and the objects are not clustered; this #' situation will not occur very often; #' \item \code{1} uses the encounter rate \eqn{n/L} (objects observed per unit -#' transect) from Buckland et al. (2001) pg 78-79 (equation 3.78) for line -#' transects (see also Fewster et al, 2009 estimator R2). This variance +#' transect) from \insertCite{buckland2001;textual}{mrds} pg 78-79 (equation 3.78) for line +#' transects (see also \insertCite{fewster2009;nobrackets}{mrds} estimator R2). This variance #' estimator is not appropriate if \code{size} or a derivative of \code{size} #' is used in the detection function; #' \item \code{2} is the default and uses the encounter rate estimator -#' \eqn{\hat{N}/L} (estimated abundance per unit transect) suggested by Innes -#' et al (2002) and Marques & Buckland (2004). +#' \eqn{\hat{N}/L} (estimated abundance per unit transect) suggested by \insertCite{innes2002;textual}{mrds} and \insertCite{marques2004;textual}{mrds} #' } #' #' In general if any covariates are used in the models, the default @@ -118,14 +116,14 @@ #' the mean group size and standard error is also reported. #' #' For options \code{1} and \code{2}, it is then possible to choose one of the -#' estimator forms given in Fewster et al (2009) for line transects: +#' estimator forms given in \insertCite{fewster2009;textual}{mrds} +#' for line transects: #' \code{"R2"}, \code{"R3"}, \code{"R4"}, \code{"S1"}, \code{"S2"}, #' \code{"O1"}, \code{"O2"} or \code{"O3"} can be used by specifying \code{ervar} #' in the list of options provided by the \code{options} argument #' (default \code{"R2"}). For points, either the \code{"P2"} or #' \code{"P3"} estimator can be selected (>=mrds 2.3.0 default \code{"P2"}, -#' <= mrds 2.2.9 default \code{"P3"}). See \code{\link{varn}} and Fewster -#' et al (2009) for further details on these estimators. +#' <= mrds 2.2.9 default \code{"P3"}). See \code{\link{varn}} and \insertCite{fewster2009;textual}{mrds} for further details on these estimators. #' #' @param model ddf model object #' @param region.table \code{data.frame} of region records. Two columns: @@ -190,38 +188,7 @@ #' @author Jeff Laake, David L Miller #' @seealso \code{\link{print.dht}} \code{\link{dht.se}} #' @references -#' -#' Borchers, D.L., S.T. Buckland, P.W. Goedhart, E.D. Clarke, and S.L. Hedley. -#' 1998. Horvitz-Thompson estimators for double-platform line transect -#' surveys. Biometrics 54: 1221-1237. -#' -#' Borchers, D.L. and K.P. Burnham. General formulation for distance sampling -#' pp 10-11 In: Advanced Distance Sampling, eds. S.T. Buckland, D.R.Anderson, -#' K.P. Burnham, J.L. Laake, D.L. Borchers, and L. Thomas. Oxford University -#' Press. -#' -#' Buckland, S.T., D.R.Anderson, K.P. Burnham, J.L. Laake, D.L. Borchers, and -#' L. Thomas. 2001. Introduction to Distance Sampling: Estimating Abundance -#' of Biological Populations. Oxford University Press. -#' -#' Fewster, R.M., S.T. Buckland, K.P. Burnham, D.L. Borchers, P.E. Jupp, J.L. -#' Laake and L. Thomas. 2009. Estimating the encounter rate variance in -#' distance sampling. Biometrics 65: 225-236. -#' -#' Huggins, R.M. 1989. On the statistical analysis of capture experiments. -#' Biometrika 76:133-140. -#' -#' Huggins, R.M. 1991. Some practical aspects of a conditional likelihood -#' approach to capture experiments. Biometrics 47: 725-732. -#' -#' Innes, S., M.P. Heide-Jorgensen, J.L. Laake, K.L. Laidre, H.J. Cleator, P. -#' Richard, and R.E.A. Stewart. 2002. Surveys of belugas and narwhals in the -#' Canadian High Arctic in 1996. NAMMCO Scientific Publications 4: 169-190. -#' -#' Marques, F.F.C. and S.T. Buckland. 2004. Covariate models for the detection -#' function. In: Advanced Distance Sampling, eds. S.T. Buckland, -#' D.R.Anderson, K.P. Burnham, J.L. Laake, D.L. Borchers, and L. Thomas. -#' Oxford University Press. +#' \insertAllCited{} #' @keywords utility #' @importFrom stats aggregate #' @export diff --git a/R/mrds-package.R b/R/mrds-package.R index f57e13d0..2d329751 100644 --- a/R/mrds-package.R +++ b/R/mrds-package.R @@ -1,17 +1,11 @@ #' Mark-Recapture Distance Sampling (mrds) #' -#' This package implements mark-recapture distance sampling -#' methods as described in D.L. Borchers, W. Zucchini and Fewster, -#' R.M. (1988), "Mark-recapture models for line transect surveys", -#' Biometrics 54: 1207-1220. and Laake, J.L. (1999) "Distance sampling -#' with independent observers: Reducing bias from heterogeneity by -#' weakening the conditional independence assumption." in Amstrup, -#' G.W., Garner, S.C., Laake, J.L., Manly, B.F.J., McDonald, L.L. and -#' Robertson, D.G. (eds) "Marine mammal survey and assessment -#' methods", Balkema, Rotterdam: 137-148 and Borchers, D.L., Laake, -#' J.L., Southwell, C. and Paxton, C.L.G. "Accommodating unmodelled -#' heterogeneity in double-observer distance sampling surveys". 2006. -#' Biometrics 62:372-378.) +#' This package implements both conventional distance sampling +#' analysis and mark-recapture distance sampling methods for when +#' detection on the transect is not certain. Mark-recapture distance sampling methods are described in +#' \insertCite{borchers1988;textual}{mrds}, \insertCite{laake1999;textual}{mrds} +#' and \insertCite{borchers2006;textual}{mrds} +#' #' #' Examples of distance sampling analyses are available at #' \url{https://distancesampling.org/resources/vignettes.html}. @@ -27,6 +21,8 @@ #' David L. Miller , #' Jon Bishop , #' Felix Petersma +#' @references +#' \insertAllCited{} #' @keywords package #' "_PACKAGE" #' diff --git a/R/varn.R b/R/varn.R index ce87eb79..330c80f4 100644 --- a/R/varn.R +++ b/R/varn.R @@ -4,7 +4,7 @@ #' encounter rate for a set of sample measurements (e.g., line lengths) and #' number of observations per sample. #' -#' The choice of type follows the notation of Fewster et al. (2009) in that there are 8 choices of encounter rate variance that can be computed for lines and one for points: +#' The choice of type follows the notation of \insertCite{fewster2009;textual}{mrds} in that there are 8 choices of encounter rate variance that can be computed for lines and one for points: #' #' \describe{ #' \item{\code{R2}}{random line placement with unequal line lengths @@ -30,9 +30,9 @@ #' visits per point, model-based estimator} #' } #' -#' Default value is \code{"R2"}, shown in Fewster et al. (2009) to have good +#' Default value is \code{"R2"}, shown in \insertCite{fewster2009;textual}{mrds} to have good #' performance for completely random designs for lines. For systematic parallel -#' line transect designs, Fewster et al. recommend \code{"O2"}. For point +#' line transect designs, \insertCite{fewster2009;textual}{mrds} recommend \code{"O2"}. For point #' transects the default is \code{"P2"} (but \code{"P3"} is also available). #' #' For the systematic estimators, pairs are assigned in the order they are @@ -49,13 +49,12 @@ #' @param type choice of variance estimator to use for encounter rate #' @return Variance of encounter rate as defined by arguments #' @note This function is also used with different calling arguments to compute -#' Innes et al variance of the estimated abundances/length rather than +#' \insertCite{innes2002;textual}{mrds} variance of the estimated abundances/length rather than #' observation encounter rate. The function covn is probably only valid for R3 #' and R2. Currently, the R2 form is used for all types other than R3. #' @author Jeff Laake, David L Miller -#' @references Fewster, R.M., S.T. Buckland, K.P. Burnham, D.L. Borchers, P.E. -#' Jupp, J.L. Laake and L. Thomas. 2009. Estimating the encounter rate -#' variance in distance sampling. Biometrics 65: 225-236. +#' @references +#' \insertAllCited{} #' @keywords utility #' @export varn <- function(lvec, nvec, type){ diff --git a/inst/REFERENCES.bib b/inst/REFERENCES.bib index c35d196d..58dd3f4d 100644 --- a/inst/REFERENCES.bib +++ b/inst/REFERENCES.bib @@ -1,3 +1,12 @@ +@article{borchers1988, + title={Mark-recapture models for line transect surveys}, + author={Borchers, D. L. and Zucchini, W. and Fewster, R. M.}, + journal={Biometrics}, + pages={1207--1220}, + year={1988}, + publisher={JSTOR} +} + @article{borchers1998, author = {Borchers, D. L. and Buckland, S. T. and Goedhart, P. W. and Clarke, E. D. and Hedley, S. L.}, title = {Horvitz-Thompson Estimators for Double-Platform Line Transect Surveys}, @@ -9,6 +18,24 @@ @article{borchers1998 doi = {10.2307/253365} } +@inbook{borchers2004, + author = {Borchers, D.L. and Burnham, K.P.}, + title = {Advanced distance sampling: estimating abundance of biological population}, + chapter = {General formulation for distance sampling}, + pages = {10-11}, + year = {2004}, + publisher = {Oxford University Press} +} + +@article{borchers2006, + title={Accommodating unmodelled heterogeneity in double-observer distance sampling surveyss}, + author={Borchers, D. L. and Laake, J.L. and Southwell, C. and Paxton, C.L.G.}, + journal={Biometrics}, + volumn={62}, + pages={372-378}, + year={2006}, +} + @book{buckland2001, title={Introduction to distance sampling: estimating abundance of biological populations}, author={Buckland, S. T. and Anderson, D. R. and Burnham, K. P. and Laake, J. L. and Borchers, D. L. and Thomas, L.}, @@ -58,6 +85,23 @@ @article{innes2002 year={2002} } +@incollection{laake1999, + title={Distance sampling with independent observers: reducing bias from heterogeneity by weakening the conditional independence assumption}, + author={Laake, J}, + booktitle={Marine mammal survey and assessment methods}, + pages={137-148}, + year={1999}, + publisher={CRC Press} +} + +@inbook{laake2004, + author = {Laake, J.L. and Borchers, D.L.}, + title = {Advanced distance sampling: estimating abundance of biological population}, + chapter = {Methods for incomplete detection at distance zero}, + year = {2004}, + publisher = {Oxford University Press} +} + @inbook{marques2004, author = {Marques, F. F. C. and Buckland, S. T.}, title = {Advanced distance sampling}, diff --git a/man/ddf.Rd b/man/ddf.Rd index a00b453e..a8c691d5 100644 --- a/man/ddf.Rd +++ b/man/ddf.Rd @@ -105,7 +105,7 @@ can be half-normal ("hn"), hazard-rate ("hr"), gamma ("gamma") or uniform for the log of the scale parameter of the key function (e.g., the equivalent of the standard deviation in the half-normal). The variable \code{distance} should not be included in the formula because the scale is for distance. -See Marques, F.F.C. and S.T. Buckland (2004) for more details on the +See \insertCite{marques2004;textual}{mrds} for more details on the representation of the scale formula. For the hazard rate and gamma functions, an additional \code{shape.formula} can be specified for the model of the shape parameter. The default will be ~1. @@ -125,7 +125,7 @@ the functions are \code{glm} and \code{gam}. The arguments for the functions are \code{formula} and \code{link}. At present, only \code{glm} is allowed and it is restricted to \code{link=logit}. Thus, currently the only form for the conditional detection functions is logistic as expressed -in eq 6.32 of Laake and Borchers (2004). In contrast to \code{dsmodel}, the +in eq 6.32 of \insertCite{laake2004;textual}{mrds}. In contrast to \code{dsmodel}, the argument \code{formula} will typically include \code{distance} and all other covariates that affect detection probability. For example, \code{mrmodel=~glm(formula=~distance+size+sex)} constructs a conditional @@ -320,15 +320,7 @@ plot(model,main="Dual observer binned point data",new=FALSE) } } \references{ -Laake, J.L. and D.L. Borchers. 2004. Methods for incomplete - detection at distance zero. In: Advanced Distance Sampling, eds. S.T. - Buckland, D.R.Anderson, K.P. Burnham, J.L. Laake, D.L. Borchers, and L. - Thomas. Oxford University Press. - -Marques, F.F.C. and S.T. Buckland. 2004. Covariate models for the detection - function. In: Advanced Distance Sampling, eds. S.T. Buckland, - D.R.Anderson, K.P. Burnham, J.L. Laake, D.L. Borchers, and L. Thomas. - Oxford University Press. +\insertAllCited{} } \seealso{ \code{\link{ddf.ds}}, \code{\link{ddf.io}}, diff --git a/man/dht.Rd b/man/dht.Rd index 8e6809df..66bf9cd7 100644 --- a/man/dht.Rd +++ b/man/dht.Rd @@ -78,8 +78,7 @@ any defined regional stratification. The variance is based on replicate samples within any regional stratification. For clustered populations, \eqn{E(s)} and its standard error are also output. -Abundance is estimated with a Horvitz-Thompson-like estimator (Huggins 1989, -1991; Borchers et al 1998; Borchers and Burnham 2004). The abundance in the +Abundance is estimated with a Horvitz-Thompson-like estimator (\insertCite{huggins1989;nobrackets}{mrds}; \insertCite{huggins1991;nobrackets}{mrds}; \insertCite{borchers1998;nobrackets}{mrds}; \insertCite{borchers2004;nobrackets}{mrds}). The abundance in the sampled region is simply \eqn{1/p_1 + 1/p_2 + ... + 1/p_n} where \eqn{p_i} is the estimated detection probability for the \eqn{i}th detection of \eqn{n} total observations. It is not strictly a Horvitz-Thompson estimator @@ -147,7 +146,7 @@ for the delta method variance. If the option \code{areas.supplied} is If the argument \code{se=TRUE}, standard errors for density and abundance is computed. Coefficient of variation and log-normal confidence intervals are constructed using a Satterthwaite approximation for degrees of freedom -(Buckland et al. 2001 p. 90). The function \code{\link{dht.se}} computes the +(\insertCite{buckland2001;nobrackets}{mrds} p 90). The function \code{\link{dht.se}} computes the variance and interval estimates. The variance has two components: @@ -157,7 +156,7 @@ The variance has two components: \item variation in abundance due to random sample selection; } The first component (model parameter uncertainty) is computed using a delta -method estimate of variance (Huggins 1989, 1991, Borchers et al. 1998) in +method estimate of variance (\insertCite{huggins1989;nobrackets}{mrds}; \insertCite{huggins1991;nobrackets}{mrds}; \insertCite{borchers1998;nobrackets}{mrds}) in which the first derivatives of the abundance estimator with respect to the parameters in the detection function are computed numerically (see \code{\link{DeltaMethod}}). @@ -168,17 +167,16 @@ estimator used. To begin with there three possible values for \code{varflag} to calculate encounter rate: \itemize{ \item \code{0} uses a binomial variance for the number of observations - (equation 13 of Borchers et al. 1998). This estimator is only useful if the + (equation 13 of \insertCite{borchers1998;nobrackets}{mrds}. This estimator is only useful if the sampled region is the survey region and the objects are not clustered; this situation will not occur very often; \item \code{1} uses the encounter rate \eqn{n/L} (objects observed per unit - transect) from Buckland et al. (2001) pg 78-79 (equation 3.78) for line - transects (see also Fewster et al, 2009 estimator R2). This variance + transect) from \insertCite{buckland2001;textual}{mrds} pg 78-79 (equation 3.78) for line + transects (see also \insertCite{fewster2009;nobrackets}{mrds} estimator R2). This variance estimator is not appropriate if \code{size} or a derivative of \code{size} is used in the detection function; \item \code{2} is the default and uses the encounter rate estimator - \eqn{\hat{N}/L} (estimated abundance per unit transect) suggested by Innes - et al (2002) and Marques & Buckland (2004). + \eqn{\hat{N}/L} (estimated abundance per unit transect) suggested by \insertCite{innes2002;textual}{mrds} and \insertCite{marques2004;textual}{mrds} } In general if any covariates are used in the models, the default @@ -187,13 +185,14 @@ account variability due to covariate effects. If the population is clustered the mean group size and standard error is also reported. For options \code{1} and \code{2}, it is then possible to choose one of the -estimator forms given in Fewster et al (2009) for line transects: +estimator forms given in \insertCite{fewster2009;textual}{mrds} +for line transects: \code{"R2"}, \code{"R3"}, \code{"R4"}, \code{"S1"}, \code{"S2"}, -\code{"O1"}, \code{"O2"} or \code{"O3"} by specifying the \code{ervar=} -option (default \code{"R2"}). For points, either the \code{"P2"} or +\code{"O1"}, \code{"O2"} or \code{"O3"} can be used by specifying \code{ervar} +in the list of options provided by the \code{options} argument +(default \code{"R2"}). For points, either the \code{"P2"} or \code{"P3"} estimator can be selected (>=mrds 2.3.0 default \code{"P2"}, -<= mrds 2.2.9 default \code{"P3"}). See \code{\link{varn}} and Fewster -et al (2009) for further details on these estimators. +<= mrds 2.2.9 default \code{"P3"}). See \code{\link{varn}} and \insertCite{fewster2009;textual}{mrds} for further details on these estimators. } \section{\code{dht} options}{ @@ -215,40 +214,10 @@ et al (2009) for further details on these estimators. } \references{ -Borchers, D.L., S.T. Buckland, P.W. Goedhart, E.D. Clarke, and S.L. Hedley. - 1998. Horvitz-Thompson estimators for double-platform line transect - surveys. Biometrics 54: 1221-1237. - -Borchers, D.L. and K.P. Burnham. General formulation for distance sampling - pp 10-11 In: Advanced Distance Sampling, eds. S.T. Buckland, D.R.Anderson, - K.P. Burnham, J.L. Laake, D.L. Borchers, and L. Thomas. Oxford University - Press. - -Buckland, S.T., D.R.Anderson, K.P. Burnham, J.L. Laake, D.L. Borchers, and - L. Thomas. 2001. Introduction to Distance Sampling: Estimating Abundance - of Biological Populations. Oxford University Press. - -Fewster, R.M., S.T. Buckland, K.P. Burnham, D.L. Borchers, P.E. Jupp, J.L. - Laake and L. Thomas. 2009. Estimating the encounter rate variance in - distance sampling. Biometrics 65: 225-236. - -Huggins, R.M. 1989. On the statistical analysis of capture experiments. - Biometrika 76:133-140. - -Huggins, R.M. 1991. Some practical aspects of a conditional likelihood - approach to capture experiments. Biometrics 47: 725-732. - -Innes, S., M.P. Heide-Jorgensen, J.L. Laake, K.L. Laidre, H.J. Cleator, P. - Richard, and R.E.A. Stewart. 2002. Surveys of belugas and narwhals in the - Canadian High Arctic in 1996. NAMMCO Scientific Publications 4: 169-190. - -Marques, F.F.C. and S.T. Buckland. 2004. Covariate models for the detection - function. In: Advanced Distance Sampling, eds. S.T. Buckland, - D.R.Anderson, K.P. Burnham, J.L. Laake, D.L. Borchers, and L. Thomas. - Oxford University Press. +\insertAllCited{} } \seealso{ -print.dht dht.se +\code{\link{print.dht}} \code{\link{dht.se}} } \author{ Jeff Laake, David L Miller diff --git a/man/dht.se.Rd b/man/dht.se.Rd index b95f2fec..c0e885d3 100644 --- a/man/dht.se.Rd +++ b/man/dht.se.Rd @@ -83,8 +83,9 @@ the mean group size and standard error is also reported. For options \code{1} and \code{2}, it is then possible to choose one of the estimator forms given in \insertCite{fewster2009;textual}{mrds}. For line transects: \code{"R2"}, \code{"R3"}, \code{"R4"}, \code{"S1"}, \code{"S2"}, -\code{"O1"}, \code{"O2"} or \code{"O3"} can be used by specifying the -\code{ervar=} option (default \code{"R2"}). For points, either the +\code{"O1"}, \code{"O2"} or \code{"O3"} can be used by specifying \code{ervar} +in the list of options provided by the \code{options} argument +(default \code{"R2"}). For points, either the \code{"P2"} or \code{"P3"} estimator can be selected (>=mrds 2.3.0 default \code{"P2"}, <= mrds 2.2.9 default \code{"P3"}). See \code{\link{varn}} and \insertCite{fewster2009;textual}{mrds} diff --git a/man/mrds-package.Rd b/man/mrds-package.Rd index 7a626755..794d4637 100644 --- a/man/mrds-package.Rd +++ b/man/mrds-package.Rd @@ -5,26 +5,22 @@ \alias{mrds} \title{Mark-Recapture Distance Sampling (mrds)} \description{ -This package implements mark-recapture distance sampling - methods as described in D.L. Borchers, W. Zucchini and Fewster, - R.M. (1988), "Mark-recapture models for line transect surveys", - Biometrics 54: 1207-1220. and Laake, J.L. (1999) "Distance sampling - with independent observers: Reducing bias from heterogeneity by - weakening the conditional independence assumption." in Amstrup, - G.W., Garner, S.C., Laake, J.L., Manly, B.F.J., McDonald, L.L. and - Robertson, D.G. (eds) "Marine mammal survey and assessment - methods", Balkema, Rotterdam: 137-148 and Borchers, D.L., Laake, - J.L., Southwell, C. and Paxton, C.L.G. "Accommodating unmodelled - heterogeneity in double-observer distance sampling surveys". 2006. - Biometrics 62:372-378.) +This package implements both conventional distance sampling +analysis and mark-recapture distance sampling methods for when +detection on the transect is not certain. Mark-recapture distance sampling methods are described in +\insertCite{borchers1988;textual}{mrds}, \insertCite{laake1999;textual}{mrds} +and \insertCite{borchers2006;textual}{mrds} } \details{ Examples of distance sampling analyses are available at -\url{http://examples.distancesampling.org/}. +\url{https://distancesampling.org/resources/vignettes.html}. For help with distance sampling and this package, there is a Google Group \url{https://groups.google.com/forum/#!forum/distance-sampling}. } +\references{ +\insertAllCited{} +} \author{ Jeff Laake , David Borchers , diff --git a/man/varn.Rd b/man/varn.Rd index c253b31c..8bf7300d 100644 --- a/man/varn.Rd +++ b/man/varn.Rd @@ -29,7 +29,7 @@ encounter rate for a set of sample measurements (e.g., line lengths) and number of observations per sample. } \details{ -The choice of type follows the notation of Fewster et al. (2009) in that there are 8 choices of encounter rate variance that can be computed for lines and one for points: +The choice of type follows the notation of \insertCite{fewster2009;textual}{mrds} in that there are 8 choices of encounter rate variance that can be computed for lines and one for points: \describe{ \item{\code{R2}}{random line placement with unequal line lengths @@ -55,9 +55,9 @@ visits per point, design-based estimator} visits per point, model-based estimator} } -Default value is \code{"R2"}, shown in Fewster et al. (2009) to have good +Default value is \code{"R2"}, shown in \insertCite{fewster2009;textual}{mrds} to have good performance for completely random designs for lines. For systematic parallel -line transect designs, Fewster et al. recommend \code{"O2"}. For point +line transect designs, \insertCite{fewster2009;textual}{mrds} recommend \code{"O2"}. For point transects the default is \code{"P2"} (but \code{"P3"} is also available). For the systematic estimators, pairs are assigned in the order they are @@ -65,14 +65,12 @@ given in the \code{lengths} and \code{groups} vectors. } \note{ This function is also used with different calling arguments to compute -Innes et al variance of the estimated abundances/length rather than +\insertCite{innes2002;textual}{mrds} variance of the estimated abundances/length rather than observation encounter rate. The function covn is probably only valid for R3 and R2. Currently, the R2 form is used for all types other than R3. } \references{ -Fewster, R.M., S.T. Buckland, K.P. Burnham, D.L. Borchers, P.E. - Jupp, J.L. Laake and L. Thomas. 2009. Estimating the encounter rate - variance in distance sampling. Biometrics 65: 225-236. +\insertAllCited{} } \author{ Jeff Laake, David L Miller From df3639ade124e476b5de4c03c898811e534fec82 Mon Sep 17 00:00:00 2001 From: Laura Marshall Date: Thu, 3 Apr 2025 12:54:27 +0100 Subject: [PATCH 08/16] Bump package version --- DESCRIPTION | 2 +- NEWS.md | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/DESCRIPTION b/DESCRIPTION index e7725001..75d89d6a 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -18,7 +18,7 @@ Description: Animal abundance estimation via conventional, multiple covariate fitting is performed via maximum likelihood. Also included are diagnostics and plotting for fitted detection functions. Abundance estimation is via a Horvitz-Thompson-like estimator. -Version: 3.0.0.9004 +Version: 3.0.0.9005 URL: https://github.com/DistanceDevelopment/mrds/ BugReports: https://github.com/DistanceDevelopment/mrds/issues Depends: diff --git a/NEWS.md b/NEWS.md index 7c632173..f92d3964 100644 --- a/NEWS.md +++ b/NEWS.md @@ -5,6 +5,7 @@ Bug Fixes * Fixed formatting issue in flnl.grad help * Now displays a warning if the user tries to fit a detection function with covariates using MCDS.exe which is not either a half-normal or a hazard rate model. (Issue #113) * Fixed so that the MCDS.exe does not try to fit a negative exponential in place of a gamme key function. (Issue #113) +* Now issues warnings when there is only a single transect and varflag option it 1 or 2. (Issue #115) # mrds 3.0.0 From 1221cf41fdf103582d17c2828d990ce296124517 Mon Sep 17 00:00:00 2001 From: Laura Marshall Date: Wed, 23 Apr 2025 16:46:24 +0100 Subject: [PATCH 09/16] Update examples URL --- R/ddf.R | 2 +- R/mcds_tools.R | 2 +- man/ddf.Rd | 2 +- man/mcds_dot_exe.Rd | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/R/ddf.R b/R/ddf.R index cb59d607..dce55b30 100644 --- a/R/ddf.R +++ b/R/ddf.R @@ -209,7 +209,7 @@ #' } #' #' Examples of distance sampling analyses are available at -#' \url{https://examples.distancesampling.org/}. +#' \url{https://distancesampling.org/resources/vignettes.html}. #' #' Hints and tips on fitting (particularly optimisation issues) are on the #' \code{\link{mrds_opt}} manual page. diff --git a/R/mcds_tools.R b/R/mcds_tools.R index 628783af..2290161b 100644 --- a/R/mcds_tools.R +++ b/R/mcds_tools.R @@ -19,7 +19,7 @@ #' choose to use only the R-based algorithm by setting \code{control=list(optimizer='R')}. #' #' For more information and examples comparing the R-based and `MCDS.exe` algorithms, -#' see our examples pages at https://examples.distancesampling.org/ +#' see our examples pages at https://distancesampling.org/resources/vignettes.html #' #' If you are running a non-Windows operating system, you can follow the #' instructions below to have `MCDS.exe` run using `wine`. diff --git a/man/ddf.Rd b/man/ddf.Rd index a8c691d5..3af7af9e 100644 --- a/man/ddf.Rd +++ b/man/ddf.Rd @@ -243,7 +243,7 @@ infrequently. The list values include: } Examples of distance sampling analyses are available at -\url{https://examples.distancesampling.org/}. +\url{https://distancesampling.org/resources/vignettes.html}. Hints and tips on fitting (particularly optimisation issues) are on the \code{\link{mrds_opt}} manual page. diff --git a/man/mcds_dot_exe.Rd b/man/mcds_dot_exe.Rd index 657ecf35..f9fbd0b0 100644 --- a/man/mcds_dot_exe.Rd +++ b/man/mcds_dot_exe.Rd @@ -25,7 +25,7 @@ the `ddf` argument \code{control=list(optimizer='MCDS')}. For completeness, one choose to use only the R-based algorithm by setting \code{control=list(optimizer='R')}. For more information and examples comparing the R-based and `MCDS.exe` algorithms, -see our examples pages at https://examples.distancesampling.org/ +see our examples pages at https://distancesampling.org/resources/vignettes.html If you are running a non-Windows operating system, you can follow the instructions below to have `MCDS.exe` run using `wine`. From 025fc289148745b3b805c418d73f73c7eec8bec5 Mon Sep 17 00:00:00 2001 From: Laura Marshall Date: Fri, 25 Apr 2025 12:05:11 +0100 Subject: [PATCH 10/16] Fix CRAN NOTE --- DESCRIPTION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DESCRIPTION b/DESCRIPTION index 75d89d6a..e01eb19e 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -22,7 +22,7 @@ Version: 3.0.0.9005 URL: https://github.com/DistanceDevelopment/mrds/ BugReports: https://github.com/DistanceDevelopment/mrds/issues Depends: - R (>= 3.0) + R (>= 4.1.0) Imports: optimx (>= 2013.8.6), mgcv, From 257b907ca2c4d77560e500b26407fda64c2f452d Mon Sep 17 00:00:00 2001 From: Laura Marshall Date: Fri, 25 Apr 2025 12:05:35 +0100 Subject: [PATCH 11/16] Fix equation rendering --- _pkgdown.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/_pkgdown.yml b/_pkgdown.yml index 5e0319c6..d9ce0061 100644 --- a/_pkgdown.yml +++ b/_pkgdown.yml @@ -1,6 +1,7 @@ url: ~ template: bootstrap: 5 + math-rendering: mathjax bslib: bg: "#fcfaf2" fg: "#14059e" From 15a5e1bb451d983ab2d14182951cd55486a6461d Mon Sep 17 00:00:00 2001 From: Laura Marshall Date: Fri, 25 Apr 2025 12:05:46 +0100 Subject: [PATCH 12/16] Remove twitter link --- _pkgdown.yml | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/_pkgdown.yml b/_pkgdown.yml index d9ce0061..ca8c9e67 100644 --- a/_pkgdown.yml +++ b/_pkgdown.yml @@ -16,12 +16,7 @@ reference: navbar: bg: primary structure: - right: [twitter, github] - components: - twitter: - icon: fa-twitter - href: https://twitter.com/distancesamp - aria-label: Twitter + right: [github] left: - text: Function reference href: reference/index.html From 13fde6a6ea2a0da08427358abf4e82f422411401 Mon Sep 17 00:00:00 2001 From: Laura Marshall Date: Fri, 25 Apr 2025 12:10:26 +0100 Subject: [PATCH 13/16] Rebuild pkgdown pages --- R/dht.R | 1 + R/mrds-package.R | 1 + docs/404.html | 13 ++- docs/LICENSE-text.html | 13 ++- docs/articles/index.html | 13 ++- docs/articles/mrds-golftees.html | 15 ++- docs/authors.html | 21 ++-- ...aGLdTylUAMQXC89YmC2DPNWubEbVmQiArmlw.woff2 | Bin 0 -> 11840 bytes ...n66aGLdTylUAMQXC89YmC2DPNWubEbVmUiAo.woff2 | Bin 0 -> 20612 bytes ...aGLdTylUAMQXC89YmC2DPNWubEbVmXiArmlw.woff2 | Bin 0 -> 9644 bytes ...aGLdTylUAMQXC89YmC2DPNWubEbVmYiArmlw.woff2 | Bin 0 -> 3676 bytes ...aGLdTylUAMQXC89YmC2DPNWubEbVmZiArmlw.woff2 | Bin 0 -> 16848 bytes ...aGLdTylUAMQXC89YmC2DPNWubEbVmaiArmlw.woff2 | Bin 0 -> 13740 bytes ...aGLdTylUAMQXC89YmC2DPNWubEbVmbiArmlw.woff2 | Bin 0 -> 7856 bytes ...aGLdTylUAMQXC89YmC2DPNWubEbVn6iArmlw.woff2 | Bin 0 -> 10576 bytes ...aGLdTylUAMQXC89YmC2DPNWubEbVnoiArmlw.woff2 | Bin 0 -> 19660 bytes docs/deps/Roboto-0.4.10/font.css | 90 +++++++++++++++ docs/deps/bootstrap-5.3.1/bootstrap.min.css | 2 +- docs/deps/data-deps.txt | 2 +- docs/index.html | 21 ++-- docs/news/index.html | 21 +++- docs/pkgdown.yml | 8 +- docs/reference/AIC.ddf.html | 13 ++- docs/reference/DeltaMethod.html | 13 ++- docs/reference/NCovered.html | 13 ++- docs/reference/add.df.covar.line.html | 13 ++- docs/reference/adj.check.order.html | 13 ++- docs/reference/adj.cos.html | 13 ++- docs/reference/adj.herm.html | 13 ++- docs/reference/adj.poly.html | 13 ++- docs/reference/adj.series.grad.cos.html | 13 ++- docs/reference/adj.series.grad.herm.html | 13 ++- docs/reference/adj.series.grad.poly.html | 13 ++- docs/reference/apex.gamma.html | 13 ++- docs/reference/assign.default.values.html | 13 ++- docs/reference/assign.par.html | 13 ++- docs/reference/average.line.cond.html | 13 ++- docs/reference/average.line.html | 13 ++- docs/reference/book.tee.data.html | 13 ++- docs/reference/calc.se.Np.html | 13 ++- docs/reference/cdf.ds.html | 13 ++- docs/reference/cds.html | 13 ++- docs/reference/check.bounds.html | 13 ++- docs/reference/check.mono.html | 13 ++- docs/reference/coef.ds.html | 13 ++- docs/reference/compute.Nht.html | 13 ++- docs/reference/covered.region.dht.html | 13 ++- docs/reference/create.bins.html | 13 ++- docs/reference/create.command.file.html | 13 ++- docs/reference/create.ddfobj.html | 13 ++- docs/reference/create.model.frame.html | 13 ++- docs/reference/create.varstructure.html | 13 ++- docs/reference/ddf.ds.html | 13 ++- docs/reference/ddf.gof.html | 13 ++- docs/reference/ddf.html | 36 +++--- docs/reference/ddf.io.fi.html | 13 ++- docs/reference/ddf.io.html | 13 ++- docs/reference/ddf.rem.fi.html | 13 ++- docs/reference/ddf.rem.html | 13 ++- docs/reference/ddf.trial.fi.html | 13 ++- docs/reference/ddf.trial.html | 13 ++- docs/reference/det.tables-1.png | Bin 48386 -> 46940 bytes docs/reference/det.tables.html | 13 ++- docs/reference/detfct.fit.html | 13 ++- docs/reference/detfct.fit.opt.html | 13 ++- docs/reference/dht.deriv.html | 13 ++- docs/reference/dht.html | 105 +++++++++++------- docs/reference/dht.se.html | 87 +++++++++++---- docs/reference/distpdf.grad.html | 13 ++- docs/reference/distpdf.html | 13 ++- docs/reference/ds.function.html | 13 ++- docs/reference/flnl.constr.grad.neg.html | 13 ++- docs/reference/flnl.grad.html | 21 ++-- docs/reference/flnl.html | 13 ++- docs/reference/flt.var.html | 13 ++- docs/reference/g0.html | 13 ++- docs/reference/getpar.html | 13 ++- docs/reference/gof.ds.html | 13 ++- docs/reference/gstdint.html | 13 ++- docs/reference/histline.html | 13 ++- docs/reference/index.html | 15 ++- docs/reference/integratedetfct.logistic.html | 13 ++- .../reference/integratelogistic.analytic.html | 13 ++- docs/reference/integratepdf.grad.html | 13 ++- docs/reference/integratepdf.html | 13 ++- docs/reference/io.glm.html | 13 ++- docs/reference/is.linear.logistic.html | 13 ++- docs/reference/is.logistic.constant.html | 13 ++- docs/reference/keyfct.grad.hn.html | 13 ++- docs/reference/keyfct.grad.hz.html | 13 ++- docs/reference/keyfct.th1.html | 13 ++- docs/reference/keyfct.th2.html | 13 ++- docs/reference/keyfct.tpn.html | 13 ++- docs/reference/lfbcvi.html | 13 ++- docs/reference/lfgcwa.html | 13 ++- docs/reference/logLik.ddf.html | 13 ++- docs/reference/logisticbyx.html | 13 ++- docs/reference/logisticbyz.html | 13 ++- docs/reference/logisticdetfct.html | 13 ++- docs/reference/logisticdupbyx.html | 13 ++- docs/reference/logisticdupbyx_fast.html | 13 ++- docs/reference/logit.html | 13 ++- docs/reference/mcds.html | 13 ++- docs/reference/mcds_dot_exe.html | 15 ++- docs/reference/mrds-package.html | 79 ++++++------- docs/reference/mrds_opt.html | 13 ++- docs/reference/nlminb_wrapper.html | 13 ++- docs/reference/p.det.html | 13 ++- docs/reference/p.dist.table.html | 13 ++- docs/reference/parse.optimx.html | 13 ++- .../pdot.dsr.integrate.logistic.html | 13 ++- docs/reference/plot.det.tables-1.png | Bin 53186 -> 53535 bytes docs/reference/plot.det.tables.html | 13 ++- docs/reference/plot.ds.html | 13 ++- docs/reference/plot.io.fi.html | 13 ++- docs/reference/plot.io.html | 13 ++- docs/reference/plot.rem.fi.html | 13 ++- docs/reference/plot.rem.html | 13 ++- docs/reference/plot.trial.fi.html | 13 ++- docs/reference/plot.trial.html | 13 ++- docs/reference/plot_cond.html | 13 ++- docs/reference/plot_layout.html | 13 ++- docs/reference/plot_uncond.html | 13 ++- docs/reference/predict.ds.html | 13 ++- docs/reference/print.ddf.gof.html | 13 ++- docs/reference/print.ddf.html | 13 ++- docs/reference/print.det.tables.html | 13 ++- docs/reference/print.dht.html | 13 ++- docs/reference/print.p_dist_table.html | 13 ++- docs/reference/print.summary.ds.html | 13 ++- docs/reference/print.summary.io.fi.html | 13 ++- docs/reference/print.summary.io.html | 13 ++- docs/reference/print.summary.rem.fi.html | 13 ++- docs/reference/print.summary.rem.html | 13 ++- docs/reference/print.summary.trial.fi.html | 13 ++- docs/reference/print.summary.trial.html | 13 ++- docs/reference/prob.deriv.html | 13 ++- docs/reference/prob.se.html | 13 ++- docs/reference/process.data.html | 13 ++- docs/reference/pronghorn.html | 13 ++- docs/reference/ptdata.distance.html | 13 ++- docs/reference/ptdata.dual.html | 13 ++- docs/reference/ptdata.removal.html | 13 ++- docs/reference/ptdata.single.html | 13 ++- docs/reference/qqplot.ddf.html | 13 ++- docs/reference/rem.glm.html | 13 ++- docs/reference/rescale_pars.html | 13 ++- docs/reference/sample_ddf.html | 13 ++- docs/reference/setbounds.html | 13 ++- docs/reference/setcov.html | 13 ++- docs/reference/setinitial.ds.html | 13 ++- docs/reference/sim.mix.html | 13 ++- docs/reference/solvecov.html | 13 ++- docs/reference/stake77.html | 13 ++- docs/reference/stake78.html | 13 ++- docs/reference/summary.ds.html | 13 ++- docs/reference/summary.io.fi.html | 13 ++- docs/reference/summary.io.html | 13 ++- docs/reference/summary.rem.fi.html | 13 ++- docs/reference/summary.rem.html | 13 ++- docs/reference/summary.trial.fi.html | 13 ++- docs/reference/summary.trial.html | 13 ++- docs/reference/survey.region.dht.html | 13 ++- docs/reference/test.breaks.html | 13 ++- docs/reference/varn.html | 33 ++++-- docs/search.json | 2 +- 166 files changed, 1618 insertions(+), 725 deletions(-) create mode 100644 docs/deps/Roboto-0.4.10/KFOMCnqEu92Fr1ME7kSn66aGLdTylUAMQXC89YmC2DPNWubEbVmQiArmlw.woff2 create mode 100644 docs/deps/Roboto-0.4.10/KFOMCnqEu92Fr1ME7kSn66aGLdTylUAMQXC89YmC2DPNWubEbVmUiAo.woff2 create mode 100644 docs/deps/Roboto-0.4.10/KFOMCnqEu92Fr1ME7kSn66aGLdTylUAMQXC89YmC2DPNWubEbVmXiArmlw.woff2 create mode 100644 docs/deps/Roboto-0.4.10/KFOMCnqEu92Fr1ME7kSn66aGLdTylUAMQXC89YmC2DPNWubEbVmYiArmlw.woff2 create mode 100644 docs/deps/Roboto-0.4.10/KFOMCnqEu92Fr1ME7kSn66aGLdTylUAMQXC89YmC2DPNWubEbVmZiArmlw.woff2 create mode 100644 docs/deps/Roboto-0.4.10/KFOMCnqEu92Fr1ME7kSn66aGLdTylUAMQXC89YmC2DPNWubEbVmaiArmlw.woff2 create mode 100644 docs/deps/Roboto-0.4.10/KFOMCnqEu92Fr1ME7kSn66aGLdTylUAMQXC89YmC2DPNWubEbVmbiArmlw.woff2 create mode 100644 docs/deps/Roboto-0.4.10/KFOMCnqEu92Fr1ME7kSn66aGLdTylUAMQXC89YmC2DPNWubEbVn6iArmlw.woff2 create mode 100644 docs/deps/Roboto-0.4.10/KFOMCnqEu92Fr1ME7kSn66aGLdTylUAMQXC89YmC2DPNWubEbVnoiArmlw.woff2 create mode 100644 docs/deps/Roboto-0.4.10/font.css diff --git a/R/dht.R b/R/dht.R index 691bb752..ada18b89 100644 --- a/R/dht.R +++ b/R/dht.R @@ -191,6 +191,7 @@ #' \insertAllCited{} #' @keywords utility #' @importFrom stats aggregate +#' @importFrom Rdpack reprompt #' @export dht <- function(model, region.table, sample.table, obs.table=NULL, subset=NULL, se=TRUE, options=list()){ diff --git a/R/mrds-package.R b/R/mrds-package.R index 2d329751..2c50fc02 100644 --- a/R/mrds-package.R +++ b/R/mrds-package.R @@ -21,6 +21,7 @@ #' David L. Miller , #' Jon Bishop , #' Felix Petersma +#' @importFrom Rdpack reprompt #' @references #' \insertAllCited{} #' @keywords package diff --git a/docs/404.html b/docs/404.html index eea0e2c6..0f169517 100644 --- a/docs/404.html +++ b/docs/404.html @@ -6,9 +6,15 @@ Page not found (404) • mrds - + - + @@ -22,7 +28,7 @@ mrds - 3.0.0 + 3.0.0.9005