Skip to content

Commit

Permalink
Merge branch 'master' into additional_distributions
Browse files Browse the repository at this point in the history
  • Loading branch information
sims1253 committed Oct 18, 2023
2 parents b4b2e07 + c0d3193 commit 49f4f8c
Show file tree
Hide file tree
Showing 82 changed files with 2,274 additions and 103 deletions.
1 change: 1 addition & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
^.*\.Rproj$
^\.Rproj\.user$
^\.github$
1 change: 1 addition & 0 deletions .github/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.html
54 changes: 54 additions & 0 deletions .github/workflows/R-CMD-check.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# 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: [master]
pull_request:
branches: [master]

name: R-CMD-check

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true


jobs:
R-CMD-check:
runs-on: ${{ matrix.config.os }}

name: ${{ matrix.config.os }} (${{ matrix.config.r }})

strategy:
fail-fast: false
matrix:
config:
- {os: macos-latest, r: 'release', rtools: ''}
#- {os: windows-latest, r: 'release', rtools: '42'}
- {os: ubuntu-latest, r: 'devel', http-user-agent: 'release', rtools: ''}
- {os: ubuntu-latest, r: 'release', rtools: ''}
- {os: ubuntu-latest, r: 'oldrel-1', rtools: ''}

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

steps:
- uses: actions/checkout@v3

- uses: r-lib/actions/setup-r@v2
with:
r-version: ${{ matrix.config.r }}
rtools-version: ${{ matrix.config.rtools }}
http-user-agent: ${{ matrix.config.http-user-agent }}
use-public-rspm: true

- uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: |
any::rcmdcheck
any::BH
any::RcppEigen
needs: check

- uses: r-lib/actions/check-r-package@v2
58 changes: 58 additions & 0 deletions .github/workflows/test-coverage.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# 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: [master]
pull_request:
branches: [master]

name: test-coverage

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

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

steps:
- uses: actions/checkout@v3

- 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
needs: coverage

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

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

- name: Upload test results
if: failure()
uses: actions/upload-artifact@v3
with:
name: coverage-test-failures
path: ${{ runner.temp }}/package

- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3
12 changes: 8 additions & 4 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ Date: 2022-10-26
Authors@R:
c(person("Maximilian", "Scholz", email = "[email protected]",
role = c("aut", "cre")),
person("Yannick", "Dzubba", role = c("ctb")))
person("Paul-Christian", "Bürkner", email = "[email protected]",
role = c("aut")),
person("Yannick", "Dzubba", role = c("aut")))
Maintainer: Maximilian Scholz <[email protected]>
License: GPL-3 + file LICENSE
Encoding: UTF-8
Expand All @@ -16,12 +18,14 @@ Imports:
stats,
lamW
Suggests:
dplyr,
testthat (>= 3.1.0),
rmutil,
extraDistr,
BBmisc,
posterior (>= 1.3.1)
posterior (>= 1.3.1),
gnorm,
logitnorm
Remotes:
paul-buerkner/brms
RoxygenNote: 7.2.3
NeedsCompilation: no
URL: https://github.com/sims1253/bayesfam
Expand Down
19 changes: 19 additions & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -11,61 +11,80 @@ export(dcauchitnormal)
export(dcloglognormal)
export(dfrechet_median)
export(dgamma_mean)
export(dgeneralized_normal)
export(dgompertz)
export(dgumbel_mean)
export(dkumaraswamy)
export(dlogistic)
export(dlogitnormal)
export(dlognormal)
export(dlognormal_natural)
export(dlomax)
export(dshifted_inv_gaussian)
export(dsimplex)
export(dsoftplusnormal)
export(dsymlognormal)
export(dunit_lindley)
export(dweibull_median)
export(erf)
export(generalized_normal)
export(gompertz)
export(gumbel_mean)
export(inv_cauchit)
export(inv_cloglog)
export(inv_logit)
export(inv_softplus)
export(inv_symlog)
export(isInt_len)
export(isLogic_len)
export(isNat_len)
export(isSingleString)
export(kumaraswamy)
export(limit_data)
export(logistic)
export(logit)
export(logitnormal)
export(lognormal_natural)
export(lomax)
export(pkumaraswamy)
export(qbeta_mean)
export(qbetaprime)
export(qgeneralized_normal)
export(qgompertz)
export(qgumbel_mean)
export(qkumaraswamy)
export(qlogistic)
export(qlomax)
export(qunit_lindley)
export(rbeta_mean)
export(rbetaprime)
export(rcauchitnormal)
export(rcloglognormal)
export(rexgauss_mean)
export(rfrechet_median)
export(rgamma_mean)
export(rgeneralized_normal)
export(rgompertz)
export(rgumbel_mean)
export(rkumaraswamy)
export(rlogistic)
export(rlogitnormal)
export(rlognormal)
export(rlognormal_natural)
export(rlomax)
export(rshifted_inv_gaussian)
export(rsimplex)
export(rsoftplusnormal)
export(rstudent_mean)
export(rsymlognormal)
export(runit_lindley)
export(rweibull_median)
export(shifted_inv_gaussian)
export(simplex)
export(softplus)
export(softplusnormal)
export(symlog)
export(symlognormal)
export(unit_lindley)
import(graphics)
import(stats)
20 changes: 20 additions & 0 deletions R/exgauss_mean.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#' Custom rexgauss with default values
#'
#' @param n Number of sampels to draw, has to be a scalar natural
#' @param mu Mean argument, mu unbound
#' @param sigma Shape parameter, sigma > 0
#' @param beta Shape parameter, beta > 0
#'
#' @return Vector of length n in exgaussian distribution
#' @export
#'
#' @examples hist(rexgauss_mean(100, 1, 2, 1))
rexgauss_mean <- function(n, mu = 0, sigma = 1, beta = 1) {
if(isTRUE(any(sigma <= 0))) {
stop("sigma has to be bigger than 0")
}
if(isTRUE(any(beta <= 0))) {
stop("beta has to be bigger than 0")
}
return(brms::rexgaussian(n, mu, sigma, beta))
}
Loading

0 comments on commit 49f4f8c

Please sign in to comment.