Skip to content

Commit

Permalink
Use 'value' as parameter name, progress #92
Browse files Browse the repository at this point in the history
  • Loading branch information
richelbilderbeek committed Mar 16, 2021
1 parent 29a325a commit 9ccf761
Show file tree
Hide file tree
Showing 19 changed files with 77 additions and 62 deletions.
4 changes: 2 additions & 2 deletions R/ccp_tree_prior_to_xml_state.R
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#' id = "anthus_nd2_sub",
#' pop_size_distr = create_normal_distr(
#' id = 123,
#' initial_value = 3.14
#' value = 3.14
#' )
#' )
#' )
Expand Down Expand Up @@ -54,7 +54,7 @@ ccp_tree_prior_to_xml_state <- function(
parameter_xml <- paste0(
parameter_xml,
">",
tree_prior$pop_size_distr$initial_value,
tree_prior$pop_size_distr$value,
"</parameter>"
)
parameter_xml
Expand Down
46 changes: 23 additions & 23 deletions R/create_distr.R
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#' @param name the distribution name. Valid
#' names can be found in \code{get_distr_names}
#' @param id the distribution's ID
#' @param initial_value the initial value for the MCMC
#' @param value the initial value for the MCMC
#' @param lower the lower bound, the lowest possible value
#' @param upper an upper limit of the uniform distribution.
#' If the upper limits needs to be infinity, set \code{upper} to \code{Inf}.
Expand Down Expand Up @@ -50,7 +50,7 @@
create_distr <- function(
name,
id,
initial_value = NA,
value = NA,
lower = NA,
upper = NA,
...
Expand All @@ -72,7 +72,7 @@ create_distr <- function(
distr <- list(
name = name,
id = id,
initial_value = initial_value,
value = value,
lower = lower,
upper = upper,
...
Expand Down Expand Up @@ -117,7 +117,7 @@ create_beta_distr <- create_distr_beta <- function(
id = NA,
alpha = 0.0,
beta = 1.0,
initial_value = NA,
value = NA,
lower = NA,
upper = NA
) {
Expand All @@ -144,7 +144,7 @@ create_beta_distr <- create_distr_beta <- function(
beautier::create_distr(
name = "beta",
id = id,
initial_value = initial_value,
value = value,
lower = lower,
upper = upper,
alpha = alpha,
Expand Down Expand Up @@ -179,7 +179,7 @@ create_beta_distr <- create_distr_beta <- function(
create_exp_distr <- create_distr_exp <- function(
id = NA,
mean = 1.0,
initial_value = NA,
value = NA,
lower = NA,
upper = NA
) {
Expand All @@ -193,7 +193,7 @@ create_exp_distr <- create_distr_exp <- function(
beautier::create_distr(
name = "exponential",
id = id,
initial_value = initial_value,
value = value,
lower = lower,
upper = upper,
mean = mean
Expand Down Expand Up @@ -237,7 +237,7 @@ create_gamma_distr <- create_distr_gamma <- function(
id = NA,
alpha = 0.5396,
beta = 0.3819,
initial_value = NA,
value = NA,
lower = NA,
upper = NA
) {
Expand Down Expand Up @@ -265,7 +265,7 @@ create_gamma_distr <- create_distr_gamma <- function(
beautier::create_distr(
name = "gamma",
id = id,
initial_value = initial_value,
value = value,
lower = lower,
upper = upper,
alpha = alpha,
Expand Down Expand Up @@ -305,7 +305,7 @@ create_inv_gamma_distr <- create_distr_inv_gamma <- function(
id = NA,
alpha = 0.0,
beta = 1.0,
initial_value = NA,
value = NA,
lower = NA,
upper = NA
) {
Expand All @@ -326,7 +326,7 @@ create_inv_gamma_distr <- create_distr_inv_gamma <- function(
beautier::create_distr(
name = "inv_gamma",
id = id,
initial_value = initial_value,
value = value,
lower = lower,
upper = upper,
alpha = alpha,
Expand Down Expand Up @@ -366,7 +366,7 @@ create_laplace_distr <- create_distr_laplace <- function(
id = NA,
mu = 0.0,
scale = 1.0,
initial_value = NA,
value = NA,
lower = NA,
upper = NA
) {
Expand All @@ -388,7 +388,7 @@ create_laplace_distr <- create_distr_laplace <- function(
beautier::create_distr(
name = "laplace",
id = id,
initial_value = initial_value,
value = value,
lower = lower,
upper = upper,
mu = mu,
Expand Down Expand Up @@ -428,7 +428,7 @@ create_log_normal_distr <- create_distr_log_normal <- function(
id = NA,
m = 0.0,
s = 0.0,
initial_value = NA,
value = NA,
lower = NA,
upper = NA
) {
Expand All @@ -450,7 +450,7 @@ create_log_normal_distr <- create_distr_log_normal <- function(
beautier::create_distr(
name = "log_normal",
id = id,
initial_value = initial_value,
value = value,
lower = lower,
upper = upper,
m = m,
Expand Down Expand Up @@ -490,7 +490,7 @@ create_normal_distr <- create_distr_normal <- function(
id = NA,
mean = 0.0,
sigma = 1.0,
initial_value = NA,
value = NA,
lower = NA,
upper = NA
) {
Expand All @@ -512,7 +512,7 @@ create_normal_distr <- create_distr_normal <- function(
beautier::create_distr(
name = "normal",
id = id,
initial_value = initial_value,
value = value,
lower = lower,
upper = upper,
mean = mean,
Expand Down Expand Up @@ -542,14 +542,14 @@ create_normal_distr <- create_distr_normal <- function(
#' @export create_one_div_x_distr create_distr_one_div_x
create_one_div_x_distr <- create_distr_one_div_x <- function(
id = NA,
initial_value = NA,
value = NA,
lower = NA,
upper = NA
) {
beautier::create_distr(
name = "one_div_x",
id = id,
initial_value = initial_value,
value = value,
lower = lower,
upper = upper
)
Expand Down Expand Up @@ -582,7 +582,7 @@ create_one_div_x_distr <- create_distr_one_div_x <- function(
create_poisson_distr <- create_distr_poisson <- function(
id = NA,
lambda = 0.0,
initial_value = NA,
value = NA,
lower = NA,
upper = NA
) {
Expand All @@ -597,7 +597,7 @@ create_poisson_distr <- create_distr_poisson <- function(
beautier::create_distr(
name = "poisson",
id = id,
initial_value = initial_value,
value = value,
lower = lower,
upper = upper,
lambda = lambda
Expand Down Expand Up @@ -626,7 +626,7 @@ create_poisson_distr <- create_distr_poisson <- function(
#' @export create_uniform_distr create_distr_uniform
create_uniform_distr <- create_distr_uniform <- function(
id = NA,
initial_value = NA,
value = NA,
lower = NA,
upper = Inf
) {
Expand All @@ -636,7 +636,7 @@ create_uniform_distr <- create_distr_uniform <- function(
beautier::create_distr(
name = "uniform",
id = id,
initial_value = initial_value,
value = value,
lower = lower,
upper = upper
)
Expand Down
2 changes: 1 addition & 1 deletion R/create_tree_prior.R
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ create_cbs_tree_prior <- create_tree_prior_cbs <- function(
create_ccp_tree_prior <- create_tree_prior_ccp <- function(
id = NA,
pop_size_distr = beautier::create_one_div_x_distr(
initial_value = 0.3
value = 0.3
)
) {
create_tree_prior(
Expand Down
2 changes: 1 addition & 1 deletion man/ccp_tree_prior_to_xml_state.Rd

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

4 changes: 2 additions & 2 deletions man/create_beta_distr.Rd

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

2 changes: 1 addition & 1 deletion man/create_ccp_tree_prior.Rd

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

4 changes: 2 additions & 2 deletions man/create_distr.Rd

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

4 changes: 2 additions & 2 deletions man/create_exp_distr.Rd

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

4 changes: 2 additions & 2 deletions man/create_gamma_distr.Rd

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

4 changes: 2 additions & 2 deletions man/create_inv_gamma_distr.Rd

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

4 changes: 2 additions & 2 deletions man/create_laplace_distr.Rd

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

4 changes: 2 additions & 2 deletions man/create_log_normal_distr.Rd

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

4 changes: 2 additions & 2 deletions man/create_normal_distr.Rd

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

Loading

3 comments on commit 9ccf761

@lintr-bot
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tests/testthat/test-create_distr.R:342:1: style: Trailing blank lines are superfluous.

^

@lintr-bot
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tests/testthat/test-create_distr.R:342:1: style: Trailing blank lines are superfluous.

^

@lintr-bot
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tests/testthat/test-create_distr.R:342:1: style: Trailing blank lines are superfluous.

^

Please sign in to comment.