Skip to content

Commit

Permalink
reduce a duplicate if clause
Browse files Browse the repository at this point in the history
  • Loading branch information
venpopov authored Feb 28, 2024
1 parent 2ca0ca1 commit f485e2a
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions R/bmm_model_SDT.R
Original file line number Diff line number Diff line change
Expand Up @@ -105,12 +105,10 @@ bmf2bf.SDT <- function(model, formula) {
# retrieve required response arguments
response <- model$resp_vars$response
stimulus <- model$resp_vars$stimulus
if (!is.null(model$resp_vars$nTrials)) {
nTrials <- model$resp_vars$nTrials
}

# set the base brmsformula given the variable names
if (!is.null(model$resp_vars$nTrials)) {
nTrials <- model$resp_vars$nTrials
brms_formula <- brms::bf(paste0(response," | ", "trials(",nTrials,")", " ~ dprime*",stimulus," - crit" ), nl = TRUE)
} else {
brms_formula <- brms::bf(paste0(response," ~ dprime*",stimulus," - crit"),nl = TRUE)
Expand Down

0 comments on commit f485e2a

Please sign in to comment.