Created
September 17, 2014 00:16
-
-
Save briandk/bec4f1faa030f37ffb09 to your computer and use it in GitHub Desktop.
Helping Cynthia with her problem
This file contains 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
getFormula <- function(checkboxOutput, variablesThatMustAppearInModel) { | |
formula <- "testScores ~" | |
variables1 <- paste(variablesThatMustAppearInModel, collapse = " + ") | |
variables2 <- paste(checkboxOutput, collapse = " + ") | |
fullCall <- paste(variables1, | |
variables2, | |
collapse = " + ", | |
sep = " + ") | |
return(paste(formula, | |
fullCall)) | |
} | |
library(ggplot2) | |
model = do.call(what = lm, | |
args = list(formula = getFormula(), | |
data = mpg)) | |
x = c("red", "blue", "green") | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment