Last active
February 22, 2018 22:15
-
-
Save jmg/86656fab907708d1af6cdf7e285ad7ae to your computer and use it in GitHub Desktop.
R build form from paras
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
buildFormula <- function(dataset, terms_array) { | |
for (i in 1:length(terms_array)) | |
assign(paste("fact", i, sep=""), L(dataset, terms_array[i])) | |
factors = array() | |
for (i in 1:length(terms_array)) | |
factors[i] <- paste("fact", i, sep="") | |
form = as.formula(paste("dataset~", paste(factors, collapse="+"))) | |
return(form) | |
} | |
#example call | |
form <- buildFormula(strain, c(1,6,12)) | |
## Fit | |
fit <- dynrq(form, tau = tau) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment