From 127d8215745399f09500ef92adca54fd3a040523 Mon Sep 17 00:00:00 2001 From: Laura Marshall Date: Wed, 2 Apr 2025 19:16:17 +0100 Subject: [PATCH 01/11] documentation corrections --- R/Distance-package.R | 2 +- R/dht2.R | 2 +- R/ds.R | 19 ++++++++++++------- man/Distance-package.Rd | 2 +- man/dht2.Rd | 2 +- man/ds.Rd | 19 ++++++++++++------- 6 files changed, 28 insertions(+), 18 deletions(-) diff --git a/R/Distance-package.R b/R/Distance-package.R index 71ce46e..968f582 100644 --- a/R/Distance-package.R +++ b/R/Distance-package.R @@ -8,7 +8,7 @@ #' necessary to use `mrds`. #' #' Examples of distance sampling analyses are available at -#' . +#' . #' #' For help with distance sampling and this package, there is a Google Group #' . diff --git a/R/dht2.R b/R/dht2.R index 4d55056..14b7a47 100644 --- a/R/dht2.R +++ b/R/dht2.R @@ -42,7 +42,7 @@ #' weighted final estimates. #' @param binomial_var if we wish to estimate abundance for the covered area #' only (i.e., study area = surveyed area) then this must be set to be -#' `TRUE` and use the binomial variance estimator of Borchers et al. +#' `TRUE` and use the negative binomial variance estimator of Borchers et al. #' (1998). This is only valid when objects are not clustered. (This situation #' is rare.) #' @return a `data.frame` (of class `dht_result` for pretty printing) with diff --git a/R/ds.R b/R/ds.R index 0cf5486..d8dcd7b 100644 --- a/R/ds.R +++ b/R/ds.R @@ -92,11 +92,13 @@ #' @param convert_units conversion between units for abundance estimation, see #' "Units", below. (Defaults to 1, implying all of the units are "correct" #' already.) -#' @param er_var encounter rate variance estimator to use when abundance -#' estimates are required. Defaults to "R2" for line transects and "P2" for -#' point transects (>= 1.0.9, earlier versions <= 1.0.8 used the "P3" estimator -#' by default for points). See [`dht2`][dht2] for more information and if more -#' complex options are required. +#' @param er_var specifies which encounter rate estimator to use in the case +#' that dht_se is TRUE, er_method is either 1 or 2 and there are two or more +#' samplers. Defaults to "R2" for line transects and "P2" for point transects +#' (>= 1.0.9, earlier versions <= 1.0.8 used the "P3" estimator by default +#' for points), both of which assume random placement of transects. For +#' systematic designs, alternative estimators may be more appropriate, +#' see [`dht2`][dht2] for more information. #' @param method optimization method to use (any method usable by #' [`optim`][stats::optim] or [`optimx`][optimx::optimx]). Defaults to #' `"nlminb"`. @@ -114,8 +116,11 @@ #' @param er_method encounter rate variance calculation: default = 2 gives the #' method of Innes et al, using expected counts in the encounter rate. Setting #' to 1 gives observed counts (which matches Distance for Windows) and 0 uses -#' binomial variance (only useful in the rare situation where study area = -#' surveyed area). See [`dht.se`][mrds::dht.se] for more details. +#' negative binomial variance (only useful in the rare situation where study area = +#' surveyed area). +#' See [`dht.se`][mrds::dht.se] for more details, noting this \code{er_method} +#' argument corresponds to the \code{varflag} element of the \code{options} +#' argument in \code{dht.se}. #' @param dht_se should uncertainty be calculated when using `dht`? Safe to #' leave as `TRUE`, used in `bootdht`. #' @param optimizer By default this is set to 'both'. In this case diff --git a/man/Distance-package.Rd b/man/Distance-package.Rd index fbac46c..0e901a4 100644 --- a/man/Distance-package.Rd +++ b/man/Distance-package.Rd @@ -14,7 +14,7 @@ analyses (such as those involving double observer surveys) one may find it necessary to use \code{mrds}. 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}. diff --git a/man/dht2.Rd b/man/dht2.Rd index dcaf41e..9ac8397 100644 --- a/man/dht2.Rd +++ b/man/dht2.Rd @@ -75,7 +75,7 @@ weighted final estimates.} \item{binomial_var}{if we wish to estimate abundance for the covered area only (i.e., study area = surveyed area) then this must be set to be -\code{TRUE} and use the binomial variance estimator of Borchers et al. +\code{TRUE} and use the negative binomial variance estimator of Borchers et al. (1998). This is only valid when objects are not clustered. (This situation is rare.)} } diff --git a/man/ds.Rd b/man/ds.Rd index 3fe5fc2..f8b872c 100644 --- a/man/ds.Rd +++ b/man/ds.Rd @@ -154,11 +154,13 @@ produced. "Units", below. (Defaults to 1, implying all of the units are "correct" already.)} -\item{er_var}{encounter rate variance estimator to use when abundance -estimates are required. Defaults to "R2" for line transects and "P2" for -point transects (>= 1.0.9, earlier versions <= 1.0.8 used the "P3" estimator -by default for points). See \code{\link{dht2}} for more information and if more -complex options are required.} +\item{er_var}{specifies which encounter rate estimator to use in the case +that dht_se is TRUE, er_method is either 1 or 2 and there are two or more +samplers. Defaults to "R2" for line transects and "P2" for point transects +(>= 1.0.9, earlier versions <= 1.0.8 used the "P3" estimator by default +for points), both of which assume random placement of transects. For +systematic designs, alternative estimators may be more appropriate, +see \code{\link{dht2}} for more information.} \item{method}{optimization method to use (any method usable by \code{\link[stats:optim]{optim}} or \code{\link[optimx:optimx]{optimx}}). Defaults to @@ -183,8 +185,11 @@ used when \code{order=NULL}.} \item{er_method}{encounter rate variance calculation: default = 2 gives the method of Innes et al, using expected counts in the encounter rate. Setting to 1 gives observed counts (which matches Distance for Windows) and 0 uses -binomial variance (only useful in the rare situation where study area = -surveyed area). See \code{\link[mrds:dht.se]{dht.se}} for more details.} +negative binomial variance (only useful in the rare situation where study area = +surveyed area). +See \code{\link[mrds:dht.se]{dht.se}} for more details, noting this \code{er_method} +argument corresponds to the \code{varflag} element of the \code{options} +argument in \code{dht.se}.} \item{dht_se}{should uncertainty be calculated when using \code{dht}? Safe to leave as \code{TRUE}, used in \code{bootdht}.} From 9ca897cf1c98d6a252cf2ca4dafffeeaeddf2a95 Mon Sep 17 00:00:00 2001 From: Laura Marshall Date: Wed, 2 Apr 2025 20:17:22 +0100 Subject: [PATCH 02/11] Citations using Rdpck --- DESCRIPTION | 4 +++- R/dht2.R | 38 +++++++++----------------------------- R/ds.R | 18 ++++++------------ inst/REFERENCES.bib | 6 ++++++ man/dht2.Rd | 36 +++++++++--------------------------- man/ds.Rd | 17 ++++++----------- 6 files changed, 39 insertions(+), 80 deletions(-) create mode 100644 inst/REFERENCES.bib diff --git a/DESCRIPTION b/DESCRIPTION index 0314c3d..93fd566 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -26,7 +26,8 @@ Depends: Imports: dplyr, methods, - rlang + rlang, + Rdpack Suggests: rmarkdown, kableExtra, @@ -45,3 +46,4 @@ Suggests: Encoding: UTF-8 Roxygen: list(markdown = TRUE) RoxygenNote: 7.3.2 +RdMacros: Rdpack diff --git a/R/dht2.R b/R/dht2.R index 14b7a47..ab11aa3 100644 --- a/R/dht2.R +++ b/R/dht2.R @@ -33,17 +33,17 @@ #' @param ci_width for use with confidence interval calculation (defined as #' 1-alpha, so the default 95 will give a 95% confidence interval). #' @param innes logical flag for computing encounter rate variance using either -#' the method of Innes et al (2002) where estimated abundance per transect +#' the method of \insertCite{innes2002;textual}{mrds} where estimated abundance per transect #' divided by effort is used as the encounter rate, vs. (when `innes=FALSE`) -#' using the number of observations divided by the effort (as in Buckland et -#' al., 2001) +#' using the number of observations divided by the effort (as in \insertCite{buckland2001;nobrackets}{mrds}) #' @param total_area for options `stratification="effort_sum"` and #' `stratification="replicate"` the area to use as the total for combined, #' weighted final estimates. #' @param binomial_var if we wish to estimate abundance for the covered area #' only (i.e., study area = surveyed area) then this must be set to be -#' `TRUE` and use the negative binomial variance estimator of Borchers et al. -#' (1998). This is only valid when objects are not clustered. (This situation +#' `TRUE` and use the negative binomial variance estimator of +#' \insertCite{borchers1998;textual}{mrds}. This is only valid when +#' objects are not clustered. (This situation #' is rare.) #' @return a `data.frame` (of class `dht_result` for pretty printing) with #' estimates and attributes containing additional information, see "Outputs" @@ -144,12 +144,12 @@ #' calculated is given here, though see references for more details. #' * *detection function*: variance from the detection function parameters is #' transformed to variance about the abundance via a sandwich estimator (see -#' e.g., Appendix C of Borchers et al (2002)). +#' e.g., Appendix C of \insertCite{borchers2002;textual}{Distance}). #' * *encounter rate*: for strata with >1 transect in them, the encounter -#' rate estimators given in Fewster et al (2009) can be specified via the +#' rate estimators given in \insertCite{fewster2009;textual}{mrds} can be specified via the #' `er_est` argument. If the argument `innes=TRUE` then calculations use the #' estimated number of individuals in the transect (rather than the -#' observed), which was give by Innes et al (2002) as a superior estimator. +#' observed), which was give by \insertCite{innes2002;textual}{mrds} as a superior estimator. #' When there is only one transect in a stratum, Poisson variance is assumed. #' Information on the Fewster encounter rate variance estimators are given in #' [`varn`][mrds::varn] @@ -209,27 +209,7 @@ #' uncertainty in multipliers #' #' @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., S.T. Buckland, and W. Zucchini. 2002 *Estimating Animal -#' Abundance: Closed Populations*. Statistics for Biology and Health. Springer -#' London. -#' -#' Buckland, S.T., E.A. Rexstad, T.A. Marques, and C.S. Oedekoven. 2015 -#' *Distance Sampling: Methods and Applications*. Methods in Statistical -#' Ecology. Springer International Publishing. -#' -#' Buckland, S.T., D.R. Anderson, K. Burnham, J.L. Laake, D.L. Borchers, and L. -#' Thomas. 2001 *Introduction to Distance Sampling: Estimating Abundance of -#' Biological Populations*. Oxford University Press. -#' -#' 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. -#' +#' \insertAllCited{} #' @name dht2 #' @examples #' \dontrun{ diff --git a/R/ds.R b/R/ds.R index d8dcd7b..4e64ea4 100644 --- a/R/ds.R +++ b/R/ds.R @@ -41,7 +41,7 @@ #' 1, 2, 3, ... are fitted when `adjustment = "cos"` and order 2, 4, 6, ... #' otherwise. For `key="hn"` or `"hr"` adjustments of order 2, 3, 4, ... are #' fitted when `adjustment = "cos"` and order 4, 6, 8, ... otherwise. See -#' Buckland et al. (2001, p. 47) for details. +#' \insertCite{buckland2001;textual}{mrds} p. 47 for details. #' @param order order of adjustment terms to fit. The default value (`NULL`) #' results in `ds` choosing the orders to use - see `nadj`. Otherwise a scalar #' positive integer value can be used to fit a single adjustment term of the @@ -152,7 +152,7 @@ #' also be supplied. Note that stratification only applies to abundance #' estimates and not at the detection function level. Density and abundance #' estimates, and corresponding estimates of variance and confidence intervals, -#' are calculated using the methods described in Buckland et al. (2001) +#' are calculated using the methods described in \insertCite{buckland2001;textual}{mrds} #' sections 3.6.1 and 3.7.1 (further details can be found in the documentation #' for [`dht`][mrds::dht]). #' @@ -177,7 +177,7 @@ #' can often be the cause of model convergence failures. It is recommended that #' one plots a histogram of the observed distances prior to model fitting so as #' to get a feel for an appropriate truncation distance. (Similar arguments go -#' for left truncation, if appropriate). Buckland et al (2001) provide +#' for left truncation, if appropriate). \insertCite{buckland2001;textual}{mrds} provide #' guidelines on truncation. #' #' When specified as a percentage, the largest `right` and smallest `left` @@ -211,7 +211,8 @@ #' monotonicity (and is by default for detection functions without covariates). #' #' Monotonicity constraints are supported in a similar way to that described -#' in Buckland et al (2001). 20 equally spaced points over the range of the +#' in \insertCite{buckland2001;textual}{mrds}. 20 equally spaced points over +#' the range of the #' detection function (left to right truncation) are evaluated at each round #' of the optimisation and the function is constrained to be either always #' less than it's value at zero (`"weak"`) or such that each value is @@ -270,14 +271,7 @@ #' @importFrom stats quantile as.formula #' @importFrom methods is #' @references -#' Buckland, S.T., Anderson, D.R., Burnham, K.P., Laake, J.L., Borchers, D.L., -#' and Thomas, L. (2001). Distance Sampling. Oxford University Press. Oxford, -#' UK. -#' -#' Buckland, S.T., Anderson, D.R., Burnham, K.P., Laake, J.L., Borchers, D.L., -#' and Thomas, L. (2004). Advanced Distance Sampling. Oxford University Press. -#' Oxford, UK. -#' +#' \insertAllCited{} #' @examples #' #' # An example from mrds, the golf tee data. diff --git a/inst/REFERENCES.bib b/inst/REFERENCES.bib new file mode 100644 index 0000000..7aaf46d --- /dev/null +++ b/inst/REFERENCES.bib @@ -0,0 +1,6 @@ +@book{borchers2002, + title={Estimating animal abundance: closed populations}, + author={Borchers, D. L. and Buckland, S. T. and Zucchini, W.}, + year={2002}, + publisher={Springer} +} \ No newline at end of file diff --git a/man/dht2.Rd b/man/dht2.Rd index 9ac8397..94173aa 100644 --- a/man/dht2.Rd +++ b/man/dht2.Rd @@ -62,10 +62,9 @@ different for each transect).} 1-alpha, so the default 95 will give a 95\% confidence interval).} \item{innes}{logical flag for computing encounter rate variance using either -the method of Innes et al (2002) where estimated abundance per transect +the method of \insertCite{innes2002;textual}{mrds} where estimated abundance per transect divided by effort is used as the encounter rate, vs. (when \code{innes=FALSE}) -using the number of observations divided by the effort (as in Buckland et -al., 2001)} +using the number of observations divided by the effort (as in \insertCite{buckland2001;nobrackets}{mrds})} \item{stratification}{what do strata represent, see "Stratification" below.} @@ -75,8 +74,9 @@ weighted final estimates.} \item{binomial_var}{if we wish to estimate abundance for the covered area only (i.e., study area = surveyed area) then this must be set to be -\code{TRUE} and use the negative binomial variance estimator of Borchers et al. -(1998). This is only valid when objects are not clustered. (This situation +\code{TRUE} and use the negative binomial variance estimator of +\insertCite{borchers1998;textual}{mrds}. This is only valid when +objects are not clustered. (This situation is rare.)} } \value{ @@ -193,12 +193,12 @@ calculated is given here, though see references for more details. \itemize{ \item \emph{detection function}: variance from the detection function parameters is transformed to variance about the abundance via a sandwich estimator (see -e.g., Appendix C of Borchers et al (2002)). +e.g., Appendix C of \insertCite{borchers2002;textual}{Distance}). \item \emph{encounter rate}: for strata with >1 transect in them, the encounter -rate estimators given in Fewster et al (2009) can be specified via the +rate estimators given in \insertCite{fewster2009;textual}{mrds} can be specified via the \code{er_est} argument. If the argument \code{innes=TRUE} then calculations use the estimated number of individuals in the transect (rather than the -observed), which was give by Innes et al (2002) as a superior estimator. +observed), which was give by \insertCite{innes2002;textual}{mrds} as a superior estimator. When there is only one transect in a stratum, Poisson variance is assumed. Information on the Fewster encounter rate variance estimators are given in \code{\link[mrds:varn]{varn}} @@ -288,23 +288,5 @@ print(minke_dht2, report="density") } } \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. -\emph{Biometrics} 54: 1221-1237. - -Borchers, D.L., S.T. Buckland, and W. Zucchini. 2002 \emph{Estimating Animal -Abundance: Closed Populations}. Statistics for Biology and Health. Springer -London. - -Buckland, S.T., E.A. Rexstad, T.A. Marques, and C.S. Oedekoven. 2015 -\emph{Distance Sampling: Methods and Applications}. Methods in Statistical -Ecology. Springer International Publishing. - -Buckland, S.T., D.R. Anderson, K. Burnham, J.L. Laake, D.L. Borchers, and L. -Thomas. 2001 \emph{Introduction to Distance Sampling: Estimating Abundance of -Biological Populations}. Oxford University Press. - -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. \emph{NAMMCO Scientific Publications} 4, 169-190. +\insertAllCited{} } diff --git a/man/ds.Rd b/man/ds.Rd index f8b872c..136727b 100644 --- a/man/ds.Rd +++ b/man/ds.Rd @@ -87,7 +87,7 @@ on the \code{key}and \code{adjustment}. For \code{key="unif"}, adjustments of or 1, 2, 3, ... are fitted when \code{adjustment = "cos"} and order 2, 4, 6, ... otherwise. For \code{key="hn"} or \code{"hr"} adjustments of order 2, 3, 4, ... are fitted when \code{adjustment = "cos"} and order 4, 6, 8, ... otherwise. See -Buckland et al. (2001, p. 47) for details.} +\insertCite{buckland2001;textual}{mrds} p. 47 for details.} \item{order}{order of adjustment terms to fit. The default value (\code{NULL}) results in \code{ds} choosing the orders to use - see \code{nadj}. Otherwise a scalar @@ -244,7 +244,7 @@ and \code{sample_table} must be supplied. If \code{data} does not contain the co also be supplied. Note that stratification only applies to abundance estimates and not at the detection function level. Density and abundance estimates, and corresponding estimates of variance and confidence intervals, -are calculated using the methods described in Buckland et al. (2001) +are calculated using the methods described in \insertCite{buckland2001;textual}{mrds} sections 3.6.1 and 3.7.1 (further details can be found in the documentation for \code{\link[mrds:dht]{dht}}). @@ -273,7 +273,7 @@ or bin end point. This is a default will not be appropriate for all data and can often be the cause of model convergence failures. It is recommended that one plots a histogram of the observed distances prior to model fitting so as to get a feel for an appropriate truncation distance. (Similar arguments go -for left truncation, if appropriate). Buckland et al (2001) provide +for left truncation, if appropriate). \insertCite{buckland2001;textual}{mrds} provide guidelines on truncation. When specified as a percentage, the largest \code{right} and smallest \code{left} @@ -311,7 +311,8 @@ lead to bias. To avoid this, the detection function can be constrained for monotonicity (and is by default for detection functions without covariates). Monotonicity constraints are supported in a similar way to that described -in Buckland et al (2001). 20 equally spaced points over the range of the +in \insertCite{buckland2001;textual}{mrds}. 20 equally spaced points over +the range of the detection function (left to right truncation) are evaluated at each round of the optimisation and the function is constrained to be either always less than it's value at zero (\code{"weak"}) or such that each value is @@ -417,13 +418,7 @@ AIC(ds.model.cos23) } } \references{ -Buckland, S.T., Anderson, D.R., Burnham, K.P., Laake, J.L., Borchers, D.L., -and Thomas, L. (2001). Distance Sampling. Oxford University Press. Oxford, -UK. - -Buckland, S.T., Anderson, D.R., Burnham, K.P., Laake, J.L., Borchers, D.L., -and Thomas, L. (2004). Advanced Distance Sampling. Oxford University Press. -Oxford, UK. +\insertAllCited{} } \seealso{ \code{\link{flatfile}}, \code{\link[mrds]{AIC.ds}}, From 90086351dbbc9b1b93ec1eac0258b0de6a74d6a5 Mon Sep 17 00:00:00 2001 From: Laura Marshall Date: Thu, 3 Apr 2025 12:54:40 +0100 Subject: [PATCH 03/11] Bump package version --- DESCRIPTION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DESCRIPTION b/DESCRIPTION index 93fd566..e4a5443 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -16,7 +16,7 @@ Description: A simple way of fitting detection functions to distance sampling Horvitz-Thompson-like estimator) if survey area information is provided. See Miller et al. (2019) for more information on methods and for example analyses. -Version: 2.0.0.9008 +Version: 2.0.0.9009 URL: https://github.com/DistanceDevelopment/Distance/ BugReports: https://github.com/DistanceDevelopment/Distance/issues Language: en-GB From bfcc717b324f527b8177c0a4c39796001a990bf2 Mon Sep 17 00:00:00 2001 From: Len Thomas Date: Sat, 19 Apr 2025 15:47:42 +0100 Subject: [PATCH 04/11] Minor updates to documentation --- DESCRIPTION | 2 +- R/dht2.R | 2 +- R/ds.R | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index e4a5443..35bedb4 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -15,7 +15,7 @@ Description: A simple way of fitting detection functions to distance sampling supported. Abundance and density estimates can also be calculated (via a Horvitz-Thompson-like estimator) if survey area information is provided. See Miller et al. (2019) for more information on - methods and for example analyses. + methods and for example analyses. Version: 2.0.0.9009 URL: https://github.com/DistanceDevelopment/Distance/ BugReports: https://github.com/DistanceDevelopment/Distance/issues diff --git a/R/dht2.R b/R/dht2.R index ab11aa3..8b54ab2 100644 --- a/R/dht2.R +++ b/R/dht2.R @@ -149,7 +149,7 @@ #' rate estimators given in \insertCite{fewster2009;textual}{mrds} can be specified via the #' `er_est` argument. If the argument `innes=TRUE` then calculations use the #' estimated number of individuals in the transect (rather than the -#' observed), which was give by \insertCite{innes2002;textual}{mrds} as a superior estimator. +#' observed), which was given by \insertCite{innes2002;textual}{mrds} as a superior estimator. #' When there is only one transect in a stratum, Poisson variance is assumed. #' Information on the Fewster encounter rate variance estimators are given in #' [`varn`][mrds::varn] diff --git a/R/ds.R b/R/ds.R index 4e64ea4..6a3f16e 100644 --- a/R/ds.R +++ b/R/ds.R @@ -114,7 +114,7 @@ #' @param max_adjustments maximum number of adjustments to try (default 5) only #' used when `order=NULL`. #' @param er_method encounter rate variance calculation: default = 2 gives the -#' method of Innes et al, using expected counts in the encounter rate. Setting +#' method of \insertCite{innes2002;textual}{mrds}, using expected counts in the encounter rate. Setting #' to 1 gives observed counts (which matches Distance for Windows) and 0 uses #' negative binomial variance (only useful in the rare situation where study area = #' surveyed area). @@ -160,7 +160,7 @@ #' [`dht`][mrds::dht] and [`dht2`][dht2] functions. #' #' Examples of distance sampling analyses are available at -#' . +#' . #' #' Hints and tips on fitting (particularly optimisation issues) are on the #' [`mrds_opt`][mrds::mrds_opt] manual page. From ed9e95520e66a7cfe0dd5f90d67c0fd505229ae1 Mon Sep 17 00:00:00 2001 From: Laura Marshall Date: Fri, 25 Apr 2025 12:24:01 +0100 Subject: [PATCH 05/11] Update examples URL's in manual and NEWS --- NEWS.md | 4 ++-- R/Distance-package.R | 2 +- R/bootdht.R | 2 +- R/bootdht_Dhat_summarize.R | 2 +- R/bootdht_Nhat_summarize.R | 2 +- R/dht2.R | 2 +- man/bootdht.Rd | 2 +- man/bootdht_Dhat_summarize.Rd | 2 +- man/bootdht_Nhat_summarize.Rd | 2 +- man/dht2.Rd | 4 ++-- man/ds.Rd | 4 ++-- man/flatfile.Rd | 2 +- 12 files changed, 15 insertions(+), 15 deletions(-) diff --git a/NEWS.md b/NEWS.md index 9c2127d..d3b5801 100644 --- a/NEWS.md +++ b/NEWS.md @@ -26,7 +26,7 @@ # Distance 1.0.7 -* dht2 now requires the object field in flatfile formatted data. The following vignette shows how to add an object field if your data does not have already have one: https://examples.distancesampling.org/Distance-cameratraps/camera-distill.html +* dht2 now requires the object field in flatfile formatted data. The following vignette shows how to add an object field if your data does not have already have one: https://distancesampling.org/Distance/articles/web-only/CTDS/camera-distill.html * Fix bugs when a uniform is fitted with no adjustments * Fixed error in dht2 when binned data used distend / distbegin @@ -112,7 +112,7 @@ * Added lots of example data sets * new abundance estimation via dht2! Handles more complex situations. * bootstrap variance estimation via bootdht -* for more examples see http://examples.distancesampling.org +* for more examples see https://distancesampling.org/resources/vignettes.html # Distance 0.9.8 diff --git a/R/Distance-package.R b/R/Distance-package.R index 968f582..60aab7d 100644 --- a/R/Distance-package.R +++ b/R/Distance-package.R @@ -72,7 +72,7 @@ NULL #' observation. #' #' The example given below was provided by Eric Rexstad. Additional examples -#' can be found at . +#' can be found at . #' #' @name flatfile #' @docType methods diff --git a/R/bootdht.R b/R/bootdht.R index 4d5c658..a926993 100644 --- a/R/bootdht.R +++ b/R/bootdht.R @@ -107,7 +107,7 @@ #' in to `bootdht` must be hard coded (otherwise you get back 0 successful #' bootstraps). For a worked example showing this, see the camera trap distance #' sampling online example at -#' . +#' . #' #' @importFrom utils txtProgressBar setTxtProgressBar getTxtProgressBar #' @importFrom stats as.formula AIC diff --git a/R/bootdht_Dhat_summarize.R b/R/bootdht_Dhat_summarize.R index c1caf4d..295cecb 100644 --- a/R/bootdht_Dhat_summarize.R +++ b/R/bootdht_Dhat_summarize.R @@ -6,7 +6,7 @@ #' estimated density (with stratum labels). #' #' Further examples of such functions can be found at -#' . +#' . #' #' @param ests output from [`dht2`][dht2]. #' @param fit fitted detection function object (unused). diff --git a/R/bootdht_Nhat_summarize.R b/R/bootdht_Nhat_summarize.R index ebba0cd..2d78dc0 100644 --- a/R/bootdht_Nhat_summarize.R +++ b/R/bootdht_Nhat_summarize.R @@ -6,7 +6,7 @@ #' estimated abundance (with stratum labels). #' #' Further examples of such functions can be found at -#' . +#' . #' #' @param ests output from [`dht2`][dht2]. #' @param fit fitted detection function object (unused). diff --git a/R/dht2.R b/R/dht2.R index 8b54ab2..3442fea 100644 --- a/R/dht2.R +++ b/R/dht2.R @@ -129,7 +129,7 @@ #' total number of animals, you should use this option. #' #' A simple example of using `stratification="geographical"` is given below. -#' Further examples can be found at +#' Further examples can be found at #' (see, e.g., the deer pellet survey). #' #' @section Variance: diff --git a/man/bootdht.Rd b/man/bootdht.Rd index d3b57c5..6927d31 100644 --- a/man/bootdht.Rd +++ b/man/bootdht.Rd @@ -154,7 +154,7 @@ parallel bootstraps is that any starting values in the model object passed in to \code{bootdht} must be hard coded (otherwise you get back 0 successful bootstraps). For a worked example showing this, see the camera trap distance sampling online example at -\url{https://examples.distancesampling.org/Distance-cameratraps/camera-distill.html}. +\url{https://distancesampling.org/Distance/articles/web-only/CTDS/camera-distill.html}. } \examples{ diff --git a/man/bootdht_Dhat_summarize.Rd b/man/bootdht_Dhat_summarize.Rd index c633c0e..f3acbd2 100644 --- a/man/bootdht_Dhat_summarize.Rd +++ b/man/bootdht_Dhat_summarize.Rd @@ -25,7 +25,7 @@ estimated density (with stratum labels). } \details{ Further examples of such functions can be found at -\url{http://examples.distancesampling.org}. +\url{https://distancesampling.org/resources/vignettes.html}. } \seealso{ \code{\link{bootdht}} which this function is to be used with and diff --git a/man/bootdht_Nhat_summarize.Rd b/man/bootdht_Nhat_summarize.Rd index 60d6a92..effadf5 100644 --- a/man/bootdht_Nhat_summarize.Rd +++ b/man/bootdht_Nhat_summarize.Rd @@ -25,7 +25,7 @@ estimated abundance (with stratum labels). } \details{ Further examples of such functions can be found at -\url{http://examples.distancesampling.org}. +\url{https://distancesampling.org/resources/vignettes.html}. } \seealso{ \code{\link{bootdht}} which this function is to be used with and diff --git a/man/dht2.Rd b/man/dht2.Rd index 94173aa..0d9590a 100644 --- a/man/dht2.Rd +++ b/man/dht2.Rd @@ -175,7 +175,7 @@ total number of animals, you should use this option. } A simple example of using \code{stratification="geographical"} is given below. -Further examples can be found at \url{http://examples.distancesampling.org/} +Further examples can be found at \url{https://distancesampling.org/resources/vignettes.html} (see, e.g., the deer pellet survey). } @@ -198,7 +198,7 @@ e.g., Appendix C of \insertCite{borchers2002;textual}{Distance}). rate estimators given in \insertCite{fewster2009;textual}{mrds} can be specified via the \code{er_est} argument. If the argument \code{innes=TRUE} then calculations use the estimated number of individuals in the transect (rather than the -observed), which was give by \insertCite{innes2002;textual}{mrds} as a superior estimator. +observed), which was given by \insertCite{innes2002;textual}{mrds} as a superior estimator. When there is only one transect in a stratum, Poisson variance is assumed. Information on the Fewster encounter rate variance estimators are given in \code{\link[mrds:varn]{varn}} diff --git a/man/ds.Rd b/man/ds.Rd index 136727b..f109313 100644 --- a/man/ds.Rd +++ b/man/ds.Rd @@ -183,7 +183,7 @@ used.} used when \code{order=NULL}.} \item{er_method}{encounter rate variance calculation: default = 2 gives the -method of Innes et al, using expected counts in the encounter rate. Setting +method of \insertCite{innes2002;textual}{mrds}, using expected counts in the encounter rate. Setting to 1 gives observed counts (which matches Distance for Windows) and 0 uses negative binomial variance (only useful in the rare situation where study area = surveyed area). @@ -252,7 +252,7 @@ For more advanced abundance/density estimation please see the \code{\link[mrds:dht]{dht}} and \code{\link{dht2}} functions. Examples of distance sampling analyses are available at -\url{http://examples.distancesampling.org/}. +\url{https://distancesampling.org/resources/vignettes.html}. Hints and tips on fitting (particularly optimisation issues) are on the \code{\link[mrds:mrds_opt]{mrds_opt}} manual page. diff --git a/man/flatfile.Rd b/man/flatfile.Rd index d968824..4ae4720 100644 --- a/man/flatfile.Rd +++ b/man/flatfile.Rd @@ -31,7 +31,7 @@ one \code{Region.Label} and a single corresponding \code{Area} duplicated for ea observation. The example given below was provided by Eric Rexstad. Additional examples -can be found at \url{http://examples.distancesampling.org/}. +can be found at \url{https://distancesampling.org/resources/vignettes.html}. } \examples{ \dontrun{ From e9c9dca936c83deb05f0e2ce643a41ee8dd26242 Mon Sep 17 00:00:00 2001 From: Laura Marshall Date: Fri, 25 Apr 2025 18:41:48 +0100 Subject: [PATCH 06/11] pkgdown build --- docs/404.html | 4 +- docs/LICENSE-text.html | 4 +- docs/articles/covariates-distill.html | 8 +- .../figure-html/basic-1.png | Bin 5558 -> 5560 bytes .../figure-html/bestmod-1.png | Bin 14275 -> 14275 bytes .../figure-html/box-1.png | Bin 4381 -> 4379 bytes docs/articles/index.html | 10 +- docs/articles/lines-distill.html | 12 +-- .../figure-html/basichist-1.png | Bin 5813 -> 5816 bytes .../figure-html/evasive-1.png | Bin 5286 -> 5290 bytes .../figure-html/evasive-2.png | Bin 5600 -> 5596 bytes .../figure-html/hnfitted-1.png | Bin 6274 -> 6283 bytes .../lines-distill_files/figure-html/qq-1.png | Bin 4523 -> 4530 bytes docs/articles/species-covariate-distill.html | 10 +- .../figure-html/plotcode-1.png | Bin 9135 -> 9141 bytes .../figure-html/actplot-1.png | Bin 6264 -> 6269 bytes .../figure-html/distances-1.png | Bin 5418 -> 5422 bytes .../figure-html/selected-1.png | Bin 4120 -> 4129 bytes .../figure-html/selected-2.png | Bin 4593 -> 4594 bytes .../web-only/differences/differences.html | 16 +++- .../figure-html/pooled-1.png | Bin 8172 -> 8244 bytes .../Remedy-size-bias-for-dolphin-surveys.html | 57 +++++++---- .../multipliers/multipliers-distill.html | 35 ++++--- .../multispecies-multioccasion-analysis.html | 16 +++- .../points/pointtransects-distill.html | 11 +-- .../figure-html/basichist-1.png | Bin 5636 -> 5641 bytes .../figure-html/gof-1.png | Bin 4806 -> 4813 bytes .../figure-html/modelfit-1.png | Bin 7835 -> 7839 bytes .../header-attrs-2.29/header-attrs.js | 12 --- .../web-only/strata/strata-distill.html | 10 +- .../figure-html/threeplot-1.png | Bin 11236 -> 11235 bytes .../web-only/variance/variance-distill.html | 18 ++-- docs/authors.html | 4 +- ...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/data-deps.txt | 2 +- docs/index.html | 8 +- docs/pkgdown.yml | 6 +- docs/reference/AIC.dsmodel.html | 4 +- docs/reference/ClusterExercise.html | 4 +- docs/reference/CueCountingExample.html | 4 +- docs/reference/Distance-package.html | 6 +- docs/reference/DuikerCameraTraps.html | 4 +- docs/reference/ETP_Dolphin.html | 4 +- docs/reference/LTExercise.html | 4 +- docs/reference/PTExercise.html | 4 +- docs/reference/QAIC.html | 4 +- docs/reference/Savannah_sparrow_1980.html | 4 +- docs/reference/Stratify_example.html | 4 +- docs/reference/Systematic_variance_1.html | 4 +- docs/reference/add_df_covar_line.html | 4 +- docs/reference/amakihi.html | 4 +- docs/reference/bootdht.html | 6 +- docs/reference/bootdht_Dhat_summarize.html | 6 +- docs/reference/bootdht_Nhat_summarize.html | 6 +- docs/reference/capercaillie.html | 4 +- docs/reference/checkdata.html | 4 +- docs/reference/convert_units.html | 4 +- docs/reference/create.bins.html | 4 +- docs/reference/create_bins.html | 4 +- docs/reference/dht2.html | 56 ++++++----- docs/reference/ds.gof.html | 4 +- docs/reference/ds.html | 50 ++++++---- docs/reference/ducknest.html | 4 +- docs/reference/dummy_ddf.html | 4 +- docs/reference/flatfile.html | 6 +- docs/reference/gof_ds.html | 4 +- docs/reference/golftees.html | 4 +- docs/reference/index.html | 4 +- docs/reference/logLik.dsmodel.html | 4 +- docs/reference/make_activity_fn.html | 4 +- docs/reference/minke.html | 4 +- docs/reference/p_dist_table.html | 4 +- docs/reference/plot.dsmodel.html | 4 +- docs/reference/predict.dsmodel.html | 4 +- docs/reference/predict.fake_ddf.html | 4 +- docs/reference/print.dht_result.html | 9 +- docs/reference/print.dsmodel.html | 4 +- docs/reference/print.summary.dsmodel.html | 4 +- docs/reference/sikadeer.html | 4 +- docs/reference/summarize_ds_models.html | 4 +- docs/reference/summary.dht_bootstrap.html | 4 +- docs/reference/summary.dsmodel.html | 4 +- docs/reference/unflatten.html | 4 +- docs/reference/unimak.html | 4 +- docs/reference/units_table.html | 4 +- docs/reference/wren.html | 4 +- 95 files changed, 394 insertions(+), 248 deletions(-) delete mode 100644 docs/articles/web-only/points/pointtransects-distill_files/header-attrs-2.29/header-attrs.js 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/docs/404.html b/docs/404.html index c362581..4978129 100644 --- a/docs/404.html +++ b/docs/404.html @@ -14,7 +14,7 @@ }; - + @@ -28,7 +28,7 @@ Distance - 2.0.0.9004 + 2.0.0.9009