Since this package depends on brms::unstr, should we not require brms >= 2.19.0? Otherwise, users with older versions of brms will get a warning on package load and then an error when brm_model is called.
# remotes::install_version("brms", version = "2.18.0")
stopifnot(packageVersion("brms") < "2.19.0")
library(brms.mmrm)
# Warning message:
# object ‘unstr’ is not exported by 'namespace:brms'
library(dplyr)
library(magrittr)
set.seed(0L)
raw_data <- brm_simulate_simple(
n_group = 3,
n_patient = 100,
n_time = 4
) %>%
extract2("data") %>%
brm_simulate_continuous(c("biomarker1", "biomarker2", "biomarker3"))
data <- brm_data(
data = raw_data,
outcome = "response",
role = "response",
group = "group",
patient = "patient",
time = "time",
covariates = c("biomarker1", "biomarker2"),
level_control = "group_1",
level_baseline = "time_1"
)
formula <- brm_formula(
data = data,
intercept = TRUE,
effect_baseline = FALSE,
effect_group = TRUE,
effect_time = TRUE,
interaction_baseline = FALSE,
interaction_group = TRUE
)
model <- brm_model(data = data, formula = formula, refresh = 0)
# Error in unstr(time = time, gr = patient) :
# could not find function "unstr"
Unstructured correlation was introduced in
brms
version 2.19.0 (https://github.com/paul-buerkner/brms/blob/master/NEWS.md)Since this package depends on
brms::unstr
, should we not require brms >= 2.19.0? Otherwise, users with older versions of brms will get a warning on package load and then an error whenbrm_model
is called.