library("gamlss2")
## basic formula
f <- y ~ x1 + x2 + log(x3)
response_name(f)[1] "y"
## formula with multiple responses
f <- y1 | y2 | y3 ~ x1 + s(x2) + x3 + te(log(x3), x4) | x2 + ti(x5)
response_name(f)[1] "y1" "y2" "y3"
## list of formulas
f <- list(
y1 ~ x1 + s(x2) + x3 + te(log(x3), x4),
y2 ~ x2 + sqrt(x5),
y3 ~ z2 + x1 + exp(x3) + s(x10)
)
response_name(f)[1] "y1" "y2" "y3"