insertCallback: Insert data into database

Description Usage Arguments

View source: R/dbCallbacks.R

Description

insertCallback takes shiny input values supplied by the user, collects them into a data.frame and then appends them into a database

Usage

1
2
3
4
5
6
insertCallback(
  inputData,
  db,
  dbTable,
  session = shiny::getDefaultReactiveDomain()
)

Arguments

inputData

a data.frame containing columns ids, labels, type, choicesTable, choicesValues, choicesLabels which correspond to

ids

The field names in the database. These ids will also be used as the inputId for shiny inputs.

labels

These are character values which will be used as the label for shiny inputs and be displayed above the input in the UI.

type

The type of shiny input to be used.

choicesTable, choicesValues, choicesLabels

Only used if the desired input has predefined choices (selectInput/selectizeInput). If neither of these inputs are used, then the values should be NA. If one of these inputs is used then:

choicesTable

Is the table in the database where the choices for the given input are.

choicesValues

Is the column in the table which stores the numeric identifier for the choice

choicesLabels

Is the column in the table which stores the character name for the choices

db

a DBIConnection object, as returned by dbConnect. In other words, the object the database connection is saved to.

dbTable

The database table the new data will be added to.

session

These parameters are handled by callModule and can be ignored.


JamesCuster/CARTMod documentation built on March 8, 2020, 5:57 a.m.