Learn R Programming

DynNom (version 4.0)

DNbuilder.lm: Shiny code for Dynamic Nomograms

Description

DNbuilder.lm provides required scripts to deploy an lm model object as a dynamic nomogram on a server on the web such as the http://shinyapps.io.

Usage

DNbuilder.lm(model, data, clevel = 0.95, covariate = c("slider", "numeric"))

Arguments

model
an lm model object
data
dataframe containing the accompanying data
clevel
confidence level required
covariate
The option to choose the type of covariate(s) input control widget for numeric values. If "slider" (the default) is chosen a shiny application with slider control widgets are used while if "numeric" is chosen numeric values input controls will be displayed.

Value

A new folder in the current working directory called DynNomapp which contains all the required scripts to deploy this dynamic nomogram on a server on the web such as the http://shinyapps.io. This folder includes ui.R, server.R and global.R script files needed to build the application and dataset.rds which is the accompanying dataset and a user guide text file called README.txt which explains how to deploy the app using all these objects.

See Also

lm, DynNom, DynNom.lm

Examples

Run this code
## Not run: 
# # a linear regression model
# model1 <- lm(Fertility ~ Agriculture + Education + Catholic , data = swiss)
# DNbuilder.lm(model1, swiss)
# 
# model2 <- lm(uptake ~ Plant + conc + Plant * conc, data = CO2)
# DNbuilder(model2, CO2)
# ## End(Not run)

if (interactive()) {
data1 <- data.frame(state.x77)
fit1 <- lm(formula = Life.Exp ~ ., data = data1)
DNbuilder(fit1, data1)
}

Run the code above in your browser using DataLab