Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- form <- "a + b + c + d"
- t <- matrix(runif(20),nrow=10,ncol=2)
- colnames(t) <- c("col1","col2")
- form.new2 <- lapply(colnames(t),function(x) as.formula(paste(x,sep="~",form)))
- form.new2
- [[1]]
- col1 ~ a + b + c + d
- <environment: 0x000000001c0809c8>
- [[2]]
- col2 ~ a + b + c + d
- <environment: 0x000000001c07d350>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement