Skip to content

Commit

Permalink
fixed initial values functions and added coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
abigailkeller committed Apr 1, 2024
1 parent 87de4bb commit 6eeae83
Show file tree
Hide file tree
Showing 8 changed files with 25 additions and 3 deletions.
1 change: 1 addition & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
^eDNAjoint\.Rproj$
^\.Rproj\.user$
^README\.Rmd$
^\.github$
4 changes: 4 additions & 0 deletions .Rhistory
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,7 @@ roxygen2::roxygenise()
install.packages("codemetar")
codemetar::write_codemeta()
codemetar::give_opinions('C:\\Users\\abiga\\Documents\\WSG\\eDNAjoint')
devtools::check()
install.packages('roxygen2')
devtools::check()
.Last.error
1 change: 1 addition & 0 deletions .github/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.html
6 changes: 6 additions & 0 deletions .github/workflows/test-coverage.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,3 +48,9 @@ jobs:
with:
name: coverage-test-failures
path: ${{ runner.temp }}/package

- name: Upload coverage reports to Codecov
uses: codecov/[email protected]
with:
token: ${{ secrets.CODECOV_TOKEN }}
slug: abigailkeller/eDNAjoint
3 changes: 2 additions & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ Imports:
RcppParallel (>= 5.0.1),
rstan (>= 2.26.23),
rstantools (>= 2.3.1.1),
tidyr
tidyr,
rlist
LinkingTo:
BH (>= 1.66.0),
Rcpp (>= 0.12.0),
Expand Down
4 changes: 4 additions & 0 deletions R/jointModel.R
Original file line number Diff line number Diff line change
Expand Up @@ -541,6 +541,7 @@ init_joint_cov <- function(n.chain,count_all,cov,initial_values){
p10 <- stats::runif(1,log(0.0001),log(0.08)),
alpha <- rep(0.1,length(cov)+1)
)
names(A[[i]]) <- c('mu','p10','alpha')
}
}

Expand Down Expand Up @@ -589,6 +590,7 @@ init_joint_cov_catchability <- function(n.chain,count_all,q_names,cov,
p10 <- stats::runif(1,log(0.0001),log(0.08)),
alpha <- rep(0.1,length(cov)+1)
)
names(A[[i]]) <- c('mu','q','p10','alpha')
}
}

Expand Down Expand Up @@ -636,6 +638,7 @@ init_joint_catchability <- function(n.chain,count_all,q_names,initial_values){
p10 <- stats::runif(1,log(0.0001),log(0.08)),
beta <- 0.5
)
names(A[[i]]) <- c('mu','q','p10','beta')
}
}

Expand Down Expand Up @@ -676,6 +679,7 @@ init_joint <- function(n.chain,count_all,initial_values){
p10 <- stats::runif(1,log(0.0001),log(0.08)),
beta <- 0.5
)
names(A[[i]]) <- c('mu','p10','beta')
}
}

Expand Down
2 changes: 2 additions & 0 deletions R/traditionalModel.R
Original file line number Diff line number Diff line change
Expand Up @@ -341,6 +341,7 @@ init_trad_catchability <- function(n.chain, count_all, q_names, initial_values){
mu <- stats::runif(length(unique(count_all$L)), 0.01, 5),
q <- as.data.frame(stats::runif(length(q_names),0.01,1))
)
names(A[[i]]) <- c('mu','q')
}
}

Expand All @@ -367,6 +368,7 @@ init_trad <- function(n.chain, count_all, initial_values){
A[[i]] <- list(
mu <- stats::runif(length(unique(count_all$L)), 0.01, 5)
)
names(A[[i]]) <- 'mu'
}
}

Expand Down
7 changes: 5 additions & 2 deletions README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,14 @@ knitr::opts_chunk$set(
```

# eDNAjoint
<img src="man/figures/logo.png" align="right" height="250" dpi="700" />
<img src="man/figures/logo.png" align="right" height="200" dpi="700" />
<!-- badges: start -->
[![R-CMD-check](https://github.com/abigailkeller/eDNAjoint/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/abigailkeller/eDNAjoint/actions/workflows/R-CMD-check.yaml)
[![test-coverage](https://github.com/abigailkeller/eDNAjoint/actions/workflows/test-coverage.yaml/badge.svg)](https://github.com/abigailkeller/eDNAjoint/actions/workflows/test-coverage.yaml)
[![codecov](https://codecov.io/gh/abigailkeller/eDNAjoint/graph/badge.svg?token=AEVR9NSQ9Z)](https://codecov.io/gh/abigailkeller/eDNAjoint)
<!-- badges: end -->

```{r}
```{r, echo=FALSE}
#' @srrstats {BS1.2a} README with high-level overview and examples here
```

Expand Down

0 comments on commit 6eeae83

Please sign in to comment.