Skip to content

Instantly share code, notes, and snippets.

@zappingseb
Created July 16, 2019 08:16
Show Gist options
  • Save zappingseb/d1e4324f980d68b25c594fbd3c8593a2 to your computer and use it in GitHub Desktop.
Save zappingseb/d1e4324f980d68b25c594fbd3c8593a2 to your computer and use it in GitHub Desktop.
# Create a linear model
model_reactive <- metaReactive2({
validate(need(is.data.frame(data_set_reactive()), "Data Set could not be created"))
validate(need(is.language(formula_reactive()), "Formula could not be created from column selections"))
metaExpr(bindToReturn = TRUE, {
model_data <- !!data_set_reactive()
lm(formula = !!formula_reactive(), data = model_data)
})
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment