I want to modify the left side of the mu.fo
formula with the value stored in the response
variable. The idea is to obtain a new formula like this: profit ~ x1 + x2
but actually I obtain response ~ x1 + x2
.
How can I use the value stored in response
variable automatically?
response <- 'profit'
mu.fo <- ~ x1 + x2
update.formula(mu.fo, response ~ .)
response <- 'profit'
mo.fo <- ~ x1 + x2
mo.fo <- as.formula(paste(response, "~ x1+x2"))
mo.fo
profit ~ x1 + x2
Este artigo é coletado da Internet.
Se houver alguma infração, entre em [email protected] Delete.
deixe-me dizer algumas palavras