Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Getting ready for version 2 #373

Closed
wants to merge 50 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
e726e74
usethis::use_readme_rmd()
joethorley Aug 15, 2024
54a7bba
usethis::use_pkgdown_github_pages()
joethorley Aug 15, 2024
0e596e0
update git ignore
joethorley Aug 15, 2024
0e28cba
pkgdown
joethorley Aug 15, 2024
0ec1dad
usethis::use_tidy_style()
joethorley Aug 15, 2024
73208c8
urlchecker::url_check()
joethorley Aug 15, 2024
d9b58dc
usethis::use_testthat(3)
joethorley Aug 15, 2024
c1bf059
Remove check environments section from cran-comments.md
joethorley Aug 15, 2024
d5abf12
Use lifecycle instead of artisanal deprecation messages
joethorley Aug 15, 2024
97f1489
usethis:::use_codecov_badge("poissonconsulting/ssdtools")
joethorley Aug 15, 2024
e541d20
usethis::use_tidy_coc()
joethorley Aug 15, 2024
c38246c
Use pak::pak("poissonconsulting/ssdtools") in README
joethorley Aug 15, 2024
7bb297c
usethis::use_tidy_dependencies() without cli
joethorley Aug 15, 2024
cc67796
edit readme
joethorley Aug 15, 2024
e120423
usethis::use_tidy_description()
joethorley Aug 15, 2024
a21e22e
usethis::use_tidy_github_actions()
joethorley Aug 15, 2024
05a2d9f
check dev
joethorley Aug 15, 2024
0e5e4fe
to dev
joethorley Aug 15, 2024
76c27ee
ssd min pmix
joethorley Aug 15, 2024
2494531
remove '` pkgdown
joethorley Aug 15, 2024
b8f43e1
& to && in if statements
joethorley Aug 15, 2024
f2c3d73
Merge branch 'dev' into upkeep-2024-08
joethorley Aug 15, 2024
9ccb596
Merge pull request #70 from poissonconsulting/upkeep-2024-08
joethorley Aug 15, 2024
7752fed
stable badge
joethorley Aug 15, 2024
c8b1075
Merge branch 'dev' of github.com:poissonconsulting/ssdtools into dev
joethorley Aug 15, 2024
cf82177
test bootstrap with censored data
joethorley Aug 15, 2024
18b951e
test is censored
joethorley Aug 16, 2024
44b83fa
test summary censored
joethorley Aug 16, 2024
ac10bef
remove redundant value
joethorley Aug 16, 2024
763abae
test partial left full censored
joethorley Aug 16, 2024
ebe750f
simplify censor
joethorley Aug 16, 2024
16fad1b
refactor censoring
joethorley Aug 16, 2024
9c85971
- Added `ssd_censor_data()`.
joethorley Aug 17, 2024
2d90026
more censoring tests
joethorley Aug 19, 2024
e52f3fb
- Deprecate `ssd_wqg_bc()` and `ssd_wqg_burrlioz()`.
joethorley Aug 19, 2024
24dab69
move to deprecated functions
joethorley Aug 19, 2024
9d42693
add `ssd_censor_data()` to _pkgdown.yml
joethorley Aug 19, 2024
3c8be89
dist_data example fixed
joethorley Aug 19, 2024
1acea3a
adding old small sample size bias
joethorley Aug 19, 2024
3a5bee5
updating small sample bias
joethorley Aug 19, 2024
73882ce
update devtools helpers
joethorley Aug 19, 2024
0d92828
updating code
joethorley Aug 19, 2024
8dcda58
update small sample bias
joethorley Aug 20, 2024
02408d7
Merge pull request #74 from poissonconsulting/b-censorplot
joethorley Aug 20, 2024
6b0754b
Merge branch 'dev' into deprecate-wqg
joethorley Aug 20, 2024
54ffefa
Merge pull request #75 from poissonconsulting/deprecate-wqg
joethorley Aug 20, 2024
0a29a51
Merge branch 'dev' into f-vignettes
joethorley Aug 20, 2024
5d43390
Merge pull request #79 from poissonconsulting/f-vignettes
joethorley Aug 20, 2024
b301d52
remove small sample bias
joethorley Aug 20, 2024
49f4618
- The optim argument `pgtol` is set to 1e-5 if not specified via the …
joethorley Aug 21, 2024
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
2 changes: 1 addition & 1 deletion CODE_OF_CONDUCT.md → .github/CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ representative at an online or offline event.
## Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported to the community leaders responsible for enforcement at .github/.
reported to the community leaders responsible for enforcement at [email protected].
All complaints will be reviewed and investigated promptly and fairly.

All community leaders are obligated to respect the privacy and security of the
Expand Down
22 changes: 13 additions & 9 deletions .github/workflows/R-CMD-check.yaml
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help

#
on:
push:
branches: [main, dev]
branches: [main, master]
pull_request:
branches: [main, dev]
branches: [main, master, dev]

name: R-CMD-check

permissions: read-all

jobs:
R-CMD-check:
runs-on: ${{ matrix.config.os }}
Expand All @@ -23,19 +25,20 @@ jobs:

- {os: windows-latest, r: 'release'}
# use 4.1 to check with rtools40's older compiler
- {os: windows-latest, r: '4.1'}
- {os: windows-latest, r: 'oldrel-3'}

- {os: ubuntu-latest, r: 'devel', http-user-agent: 'release'}
- {os: ubuntu-latest, r: 'release'}
- {os: ubuntu-latest, r: 'oldrel-1'}
- {os: ubuntu-latest, r: 'oldrel-2'}
- {os: ubuntu-latest, r: 'devel', http-user-agent: 'release'}
- {os: ubuntu-latest, r: 'release'}
- {os: ubuntu-latest, r: 'oldrel-1'}
- {os: ubuntu-latest, r: 'oldrel-2'}
- {os: ubuntu-latest, r: 'oldrel-3'}

env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
R_KEEP_PKG_SOURCE: yes

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- uses: r-lib/actions/setup-pandoc@v2

Expand All @@ -53,3 +56,4 @@ jobs:
- uses: r-lib/actions/check-r-package@v2
with:
upload-snapshots: true
build_args: 'c("--no-manual","--compact-vignettes=gs+qpdf")'
12 changes: 7 additions & 5 deletions .github/workflows/pkgdown.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,16 @@
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
on:
push:
branches: main
branches: [main, master]
pull_request:
branches: main
branches: [main, master, dev]
release:
types: [published]
workflow_dispatch:

name: pkgdown
name: pkgdown.yaml

permissions: read-all

jobs:
pkgdown:
Expand All @@ -22,7 +24,7 @@ jobs:
permissions:
contents: write
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- uses: r-lib/actions/setup-pandoc@v2

Expand All @@ -41,7 +43,7 @@ jobs:

- name: Deploy to GitHub pages 🚀
if: github.event_name != 'pull_request'
uses: JamesIves/github-pages-deploy-action@v4.4.1
uses: JamesIves/github-pages-deploy-action@v4.5.0
with:
clean: false
branch: gh-pages
Expand Down
31 changes: 21 additions & 10 deletions .github/workflows/test-coverage.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,49 +2,60 @@
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
on:
push:
branches: main
branches: [main, master]
pull_request:
branches: main
branches: [main, master, dev]

name: test-coverage
name: test-coverage.yaml

permissions: read-all

jobs:
test-coverage:
runs-on: macos-latest
runs-on: ubuntu-latest
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- uses: r-lib/actions/setup-r@v2
with:
use-public-rspm: true

- uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: any::covr
extra-packages: any::covr, any::xml2
needs: coverage

- name: Test coverage
run: |
covr::codecov(
cov <- covr::package_coverage(
quiet = FALSE,
clean = FALSE,
install_path = file.path(Sys.getenv("RUNNER_TEMP"), "package")
install_path = file.path(normalizePath(Sys.getenv("RUNNER_TEMP"), winslash = "/"), "package")
)
covr::to_cobertura(cov)
shell: Rscript {0}

- uses: codecov/codecov-action@v4
with:
fail_ci_if_error: true
file: ./cobertura.xml
plugin: noop
disable_search: true
token: ${{ secrets.CODECOV_TOKEN }}

- name: Show testthat output
if: always()
run: |
## --------------------------------------------------------------------
find ${{ runner.temp }}/package -name 'testthat.Rout*' -exec cat '{}' \; || true
find '${{ runner.temp }}/package' -name 'testthat.Rout*' -exec cat '{}' \; || true
shell: bash

- name: Upload test results
if: failure()
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: coverage-test-failures
path: ${{ runner.temp }}/package
11 changes: 5 additions & 6 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,8 @@

*.html

docs/
inst/docs/
inst/doc
paper/paper.pdf
scripts/boron_samples1
scripts/checks.md
/docs/
/inst/docs/
/paper/paper.pdf
/scripts/boron_samples1
/scripts/checks.md
18 changes: 9 additions & 9 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@ Description: Species sensitivity distributions are cumulative probability
different species as described by Posthuma et al.(2001)
<isbn:9781566705783>. The ssdtools package uses Maximum Likelihood to
fit distributions such as the gamma, log-logistic, log-normal and
log-normal log-normal mixture. Multiple distributions can
be averaged using Akaike Information Criteria. Confidence intervals
on hazard concentrations and proportions are produced by parametric
log-normal log-normal mixture. Multiple distributions can be averaged
using Akaike Information Criteria. Confidence intervals on hazard
concentrations and proportions are produced by parametric
bootstrapping.
License: Apache License (== 2.0) | file LICENSE
URL: https://github.com/bcgov/ssdtools, https://bcgov.github.io/ssdtools/
Expand All @@ -53,6 +53,7 @@ Imports:
furrr,
generics,
ggplot2,
glue,
goftest,
graphics,
grid,
Expand All @@ -61,6 +62,7 @@ Imports:
plyr,
purrr,
Rcpp,
rlang,
scales,
ssddata,
stats,
Expand All @@ -69,7 +71,8 @@ Imports:
TMB,
universals,
utils,
VGAM
VGAM,
withr
Suggests:
actuar,
covr,
Expand All @@ -80,7 +83,6 @@ Suggests:
fitdistrplus,
foreach,
future,
glue,
grDevices,
knitr,
magrittr,
Expand All @@ -89,13 +91,11 @@ Suggests:
R.rsp,
readr,
reshape2,
rlang,
rmarkdown,
testthat,
testthat (>= 3.0.0),
tidyr,
tidyselect,
tinytex,
withr
tinytex
LinkingTo:
Rcpp,
RcppEigen,
Expand Down
4 changes: 4 additions & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ export(rgompertz)
export(rlgumbel)
export(scale_color_ssd)
export(scale_colour_ssd)
export(ssd_censor_data)
export(ssd_data)
export(ssd_dists)
export(ssd_dists_all)
Expand Down Expand Up @@ -145,6 +146,7 @@ export(tidy)
export(waiver)
import(chk)
import(ggplot2)
import(rlang)
importFrom(Rcpp,sourceCpp)
importFrom(TMB,MakeADFun)
importFrom(TMB,sdreport)
Expand All @@ -159,6 +161,7 @@ importFrom(generics,tidy)
importFrom(ggplot2,autoplot)
importFrom(ggplot2,sym)
importFrom(ggplot2,waiver)
importFrom(glue,glue)
importFrom(goftest,ad.test)
importFrom(goftest,cvm.test)
importFrom(graphics,par)
Expand All @@ -173,6 +176,7 @@ importFrom(grid,segmentsGrob)
importFrom(lifecycle,deprecate_soft)
importFrom(lifecycle,deprecate_stop)
importFrom(lifecycle,deprecate_warn)
importFrom(lifecycle,deprecated)
importFrom(lifecycle,expect_deprecated)
importFrom(parallel,nextRNGStream)
importFrom(parallel,nextRNGSubStream)
Expand Down
2 changes: 1 addition & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ ssdtools version 1.0.0 is the first major release of `ssdtools` with some import

## Fitting

An important change to the functionality of `ssd_fit_dists()` was to switch from model fitting using [`fitdistrplus`](https://github.com/aursiber/fitdistrplus) to [`TMB`](https://github.com/kaskr/adcomp) which has resulted in improved handling of censored data.
An important change to the functionality of `ssd_fit_dists()` was to switch from model fitting using [`fitdistrplus`](https://github.com/lbbe-software/fitdistrplus) to [`TMB`](https://github.com/kaskr/adcomp) which has resulted in improved handling of censored data.
Although it was hoped that model fitting would be faster this is currently not the case.

As a result of the change the `fitdists` objects returned by `ssd_fit_dists()` from previous versions of `ssdtools` are not compatible with the major release and should be regenerated.
Expand Down
22 changes: 11 additions & 11 deletions R/bcanz.R
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ ssd_dists_bcanz <- function(npars = c(2L, 5L)) {
chk_unique(npars)
check_dim(npars, values = 1:2)
chk_subset(npars, c(2L, 5L))

ssd_dists(bcanz = TRUE, npars = npars)
}

Expand All @@ -50,8 +50,8 @@ ssd_dists_bcanz <- function(npars = c(2L, 5L)) {
#' ssd_fit_bcanz(ssddata::ccme_boron)
ssd_fit_bcanz <- function(data, left = "Conc", dists = ssd_dists_bcanz()) {
ssd_fit_dists(data,
left = left,
dists = dists
left = left,
dists = dists
)
}

Expand All @@ -72,10 +72,10 @@ ssd_fit_bcanz <- function(data, left = "Conc", dists = ssd_dists_bcanz()) {
#' ssd_hc_bcanz(fits, nboot = 100)
ssd_hc_bcanz <- function(x, nboot = 10000, min_pboot = 0.95) {
ssd_hc(x,
proportion = c(0.01, 0.05, 0.1, 0.2),
ci = TRUE,
nboot = nboot,
min_pboot = min_pboot
proportion = c(0.01, 0.05, 0.1, 0.2),
ci = TRUE,
nboot = nboot,
min_pboot = min_pboot
)
}

Expand All @@ -95,9 +95,9 @@ ssd_hc_bcanz <- function(x, nboot = 10000, min_pboot = 0.95) {
#' ssd_hp_bcanz(fits, nboot = 100)
ssd_hp_bcanz <- function(x, conc = 1, nboot = 10000, min_pboot = 0.95) {
ssd_hp(x,
conc = conc,
ci = TRUE,
nboot = nboot,
min_pboot = min_pboot
conc = conc,
ci = TRUE,
nboot = nboot,
min_pboot = min_pboot
)
}
Loading
Loading