Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,8 @@ LICENSE
^appveyor\.yml$
.gitignore
.github
^.*\.Rproj$
^\.Rproj\.user$
^_pkgdown\.yml$
^docs$
^pkgdown$
512 changes: 512 additions & 0 deletions .Rhistory

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
*.Rproj
.Rproj.user
7 changes: 7 additions & 0 deletions Clarity.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<script type="text/javascript">
(function(c,l,a,r,i,t,y){
c[a]=c[a]||function(){(c[a].q=c[a].q||[]).push(arguments)};
t=l.createElement(r);t.async=1;t.src="https://www.clarity.ms/tag/"+i;
y=l.getElementsByTagName(r)[0];y.parentNode.insertBefore(t,y);
})(window, document, "clarity", "script", "maw5mo10ad");
</script>
24 changes: 22 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,28 @@ Maintainer: Laura Marshall <[email protected]>
License: GPL (>= 2)
Title: Density Surface Modelling of Distance Sampling Data
LazyLoad: yes
Author: David L. Miller, Eric Rexstad, Louise Burt, Mark V. Bravington,
Sharon Hedley, Megan Ferguson, Natalie Kelly.
Authors@R:
c(person(given=c("David", "L."),
family="Miller",
role=c("aut")),
person(given="Eric",
family="Rexstad",
role="ctb"),
person(given="Louise",
family="Burt",
role="ctb"),
person(given=c("Mark", "V."),
family="Bravington",
role="ctb"),
person(given="Sharon",
family="Hedley",
role="ctb"),
person(given="Megan",
family="Ferguson",
role="ctb"),
person(given="Natalie",
family="Kelly",
role="ctb"))
Description: Density surface modelling of line transect data. A Generalized
Additive Model-based approach is used to calculate spatially-explicit estimates
of animal abundance from distance sampling (also presence/absence and strip
Expand Down
84 changes: 28 additions & 56 deletions NEWS → NEWS.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
dsm 2.3.4
------------------
# dsm 2.3.4

- fix bug where if predictions were NA (e.g., predictions outside the soap boundary), all variances were NA due to propagation (#4)


dsm 2.3.3
------------------
# dsm 2.3.3

* To improve consistency in functions in the package, some functions have changed from . separation to _. For function arguments some separators have been switched from _ to .. An error is now thrown when the "old" arguments/functions using . are used. This error will be removed in dsm 2.3.4.
- dsm.var.prop -> dsm_var_prop
Expand All @@ -17,14 +15,12 @@ dsm 2.3.3
- dsm_varprop
- var_type -> var.type

dsm 2.3.2
------------------
# dsm 2.3.2

* fixed bug in offset calculation in dsm_varprop se estimation where offsets were logged twice. Thanks to Megan Ferguson for spotting this.
* documentation now in rmarkdown format

dsm 2.3.1
------------------
- dsm 2.3.1

* transect type (line or point) is now determined from the detection function rather than using the transect= argument
* multiple detection functions are now possible, use a list() of fitted detection functions supplied to ddf.obj= argument to dsm(). dsm.var.gam, dsm.var.prop and dsm_varprop are compatible. Vignette coming soon. Thanks to Dave Fifield and Ewan Wakefield for extensive testing and suggestions. See ?"dsm-data" for more information on how to set up your data.
Expand All @@ -38,34 +34,29 @@ dsm 2.3.1
* availability= argument now works differently for count models. availability must now be the same length as number of segments (nrow(segment.data)) and will multiply the offset (effective area) rather than the number of animals observed to be more coherent with how detectability is handled in this case.
* dsm_varprop no longer requies newdata to be supplied. If newdata isn't present just the refitted and original models are returned, with other entries NA.

dsm 2.3.0
------------------
# dsm 2.3.0

* fixed dsm_varprop (gam.fixed.priors) for response distributions with fixed scale parameters. Negative binomial results before now may have been incorrect!

dsm 2.2.18
------------------
# dsm 2.2.18

* Clarification of the predict.dsm return documentation. Thanks to Dave Fifield for the suggestion.
* off.set=NULL lead to predictions of 0 when density was used. Now just returns density. Thanks to Dave Fifield for the catch.


dsm 2.2.17
------------------
# dsm 2.2.17

* Now Suggests package "sp" (needed for some parts of the mexdolphin example data)

dsm 2.2.16
------------------
# dsm 2.2.16

* check that any Sample.Labels match up, if none do then throw an error. Thanks to Madhura Davate for bringing this issue to my attention.
* gamma option removed, since it now is not ignored by gam(). If using method="GCV.Cp" then gamma=1.4 should still be used (but generally we advise using REML rather than GCV for smoothing parameter selection)
* dsm now requires mgcv version 1.8-23 or higher.
* dsm.var.prop (and dsm_varprop) now throw an error when there are no covariates in the detection function as it can't do anything useful
* new function obs_exp is a diagnostic function to compare observed and expected counts at different covariate aggregations

dsm 2.2.15
------------------
# dsm 2.2.15

* when mexdolphins is loaded using data(), the data no longer need to be attach()ed
* dsm.var.prop throws an error when count or N are not used as the response.
Expand All @@ -78,22 +69,19 @@ dsm 2.2.15
* fix potential issue with negative binomial response is used with variance propagation (due to scale parameterisations). dsm_varprop now refits nb() models as negbin() but we advise users to look into this more deeply. Thanks to Eric Rexstad for spotting this.
* fix bug in predict.dsm() where predictions for "density" response were not including the offset. Thanks to Len Thomas for spotting this.

dsm 2.2.14
------------------
# dsm 2.2.14

* nasty bug in predict.dsm fixed: was logging the offset twice when newdata was not provided, leading to very odd checking plots. This also effected the results of predict() when newdata= was not specified. Thanks to Megan Ferguson for alerting us to this.
* add support for point transects(!)
* rqgam.check() now produced ONLY the linear predictor vs. randomised quantile residuals plot to avoid confusion in interpreting the other plots
* REML is now default method for smoothing parameter selection

dsm 2.2.13
------------------
# dsm 2.2.13

* dsm.var.gam now has an example
* dsm.var.prop now checks that the detection function model does not have covariates

dsm 2.2.12
------------------
# dsm 2.2.12

* The alpha argument now works for analytical variance reported using dsm.var.prop and dsm.var.gam print.summary and summary methods. Thanks to Jason Roberts and Eric Rexstad for spotting this issue.
* dsm now uses numDeriv::grad to calculate derivatives for variance estimation -- this should be much faster. Thanks to Jason Roberts for this fix.
Expand All @@ -102,102 +90,86 @@ dsm 2.2.12
* ensured that ordering of segments matched the ordering of the observations so that aggregation of observations are correct. Thanks to Dave Fifield for reporting this bug and suggesting a fix.
* check.cols no longer checks to see if there is a column called "distance" when strip transects are being used

dsm 2.2.11
------------------
# dsm 2.2.11

* dsm.var.prop uses update() rather than messing around with eval()
* print.summary.dsm.var didn't work for GAM variance when no detection function was specified, now fixed (thanks to Natalia Dellabianca for spotting this)
* Removed non-working plot() code in variance examples -- see the Mexico pantropical spotted dolphins for a proper treatment of plotting using projections (http://distancesampling.org/R/vignettes/mexico-analysis.html)
* plot.var.gam no longer crashes by default when distance data doesn't have columns "x" and "y"

dsm 2.2.10
------------------
# dsm 2.2.10

* corrected offsets in examples in dsm, dsm.var.prop, dsm.var.movblk
* updated mexdolphins data with lat/long reversal in prediction data and non-list storage
* stopped use of rqgam.check from being used with non-negbin/Tweedie responses (thanks to Phil Bouchet for highlighting this issue).

dsm 2.2.9
------------------
# dsm 2.2.9

* Moving block bootstrap now works when there is no detection function (suggested by Laura Williamson)
* Mexico dolphin data has had the areas of the prediction grids and segments re-projected. Thanks to Phil Bouchet for pointing out this error. Context: https://groups.google.com/d/msg/distance-sampling/oj1j8mSmnTc/3cOAAJgBw9MJ


dsm 2.2.8
------------------
# dsm 2.2.8

* Speed up and reduced memory usage in variance calculations, thanks to Filipe Dias for asking about this.
* Better error when no observations are matched to the detection function. Thanks to Ricardo Lima for highlighting this.
* Check for missing columns had incorrect logic, now corrected and with tests. Thanks to Julia Migné for spotting this.

dsm 2.2.7
------------------
# dsm 2.2.7

* Plotting check plots using random quantile residuals (rqgam.check) didn't work for Tweedie or tw family models, now fixed. Thanks to Laura Mannocci and Jason Roberts for pointing this out.
* Plotting CV used matrix() to coerce data into a data.frame -- thus converting all elements to the simplest type. Errors ensued. Thanks to Adrian Schiavini for finding this bug!

dsm 2.2.6
------------------
# dsm 2.2.6

* dsm.var.prop and dsm.var.gam now allow you to supply a single number as an offset, then copy it as many times as you need. Thanks to Filipe Dias for suggesting this.

dsm 2.2.5
------------------
# dsm 2.2.5

* dsm.var.prop will now throw an error if there is no detection function in the dsm that it's trying to calculate the variance for (thanks to Adrián Schiavini for finding this)
* variance/CV plotting threw an error when no detection function was supplied but observation=TRUE. Now error is sidestepped (again, thanks to Adrián Schiavini for finding this).

dsm 2.2.4
------------------
# dsm 2.2.4

* changed stop() to warning() when data not in the detection function are included in the observation data frame, as they are automatically excluded later, bug found by Eric Rexstad and Anna Cucknell

dsm 2.2.3
------------------
# dsm 2.2.3

* moving block boostrap was using observed abundances as the residuals and therefore gave wrong answers (Eric Rexstad found this bug)

dsm 2.2.2
------------------
# dsm 2.2.2

* version number reporting now works (Len Thomas found this bug)
* more documentation
* by default density and presence models are now weighted by area of each segment

dsm 2.2.1
------------------
# dsm 2.2.1

* switch over to new testthat spec
* added new response variables (Dhat, density.est, count, n), suggestion from Len Thomas

dsm 2.1.4
------------------
# dsm 2.1.4

* check that all observed distances are within width will now throw an error

dsm 2.1.3
------------------
# dsm 2.1.3

* CRAN-compatibility fixes

dsm 2.1.2
------------------
# dsm 2.1.2

* updates to dsm.cor
* more unified plotting
* variance estimation tweaks for non-dsm models

dsm 2.0.6
------------------
# dsm 2.0.6

* removed warning about if() comparison length in make.soapgrid need to pass bnd as a list()
* dsm.cor now handles gamm objects
* dsm.cor allows one to check residual autocorrelation in your models
* presence/absence data now no longer needs a dummy detection function object

dsm 2.0.5
------------------
# dsm 2.0.5

* started NEWS file
* fixed bug where dsm.var.gam() didn't return predictions so plotting the result would fail
Expand Down
9 changes: 7 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,14 @@

`dsm` provides a Generalized Additive Model (GAM)-based approach to calculate spatially-explicit estimates of animal abundance from distance sampling (also presence/absence and strip transect) data. Several utility functions are provided for model checking, plotting and variance estimation.

Open Access paper describing the methods: [Miller, DL, ML Burt, EA Rexstad and L Thomas (2013). Spatial models for distance sampling data: recent developments and future directions. Methods in Ecology and Evolution.]( https://doi.org/10.1111/2041-210X.12105)
Open Access paper describing the methods:

- Miller, DL, ML Burt, EA Rexstad and L Thomas (2013). Spatial models for distance sampling data: recent developments and future directions. Methods in Ecology and Evolution. [https://doi.org/10.1111/2041-210X.12105](https://doi.org/10.1111/2041-210X.12105)

# Using `dsm`

Examples of how to use `dsm` and other distance sampling R packages are available at [examples.distancesampling.org](http://examples.distancesampling.org).
Examples of how to use `dsm` see

- https://distancesampling.org/dsm/articles/data_format/dsm-data-formatting.html
- https://distancesampling.org/dsm/articles/lines_gomex/mexico-analysis.html

31 changes: 31 additions & 0 deletions _pkgdown.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
url: ~
template:
bootstrap: 5
bslib:
bg: "#fcfaf2"
fg: "#000000"
primary: "#0542a3"
includes:
in_header: |
<script type="text/javascript"> (function(c,l,a,r,i,t,y){ c[a]=c[a]||function(){(c[a].q=c[a].q||[]).push(arguments)}; t=l.createElement(r);t.async=1;t.src="https://www.clarity.ms/tag/"+i; y=l.getElementsByTagName(r)[0];y.parentNode.insertBefore(t,y);})(window, document, "clarity", "script","maw5mo10ad");</script>

navbar:
bg: primary
structure:
right: [twitter, github]
components:
twitter:
icon: fa-twitter
href: https://twitter.com/distancesamp
aria-label: Twitter
footer:
structure:
right: donate
left: clarity

components:
donate: "If you wish to donate to development and maintenance, please <a href='mailto:[email protected]'>email us</a>."
clarity: "We improve our site and software support by using Microsoft Clarity to see <br>
how you use our website. By using our site, you agree that we and Microsoft <br>
can collect and use this data. Clarity is GDPR compliant."

81 changes: 81 additions & 0 deletions docs/404.html

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

Loading
Loading