checkDuplicateFunction: Check for duplicated entries before addition

Description Usage Arguments

View source: R/addEditModules.R

Description

This function takes a character vector of fields to check in the database for a possible duplication before an addition occurs

Usage

1
2
3
4
5
6
7
8
checkDuplicateFunction(
  checkDuplicate,
  reactiveData,
  inputData,
  db,
  dbTable,
  session = shiny::getDefaultReactiveDomain()
)

Arguments

checkDuplicate

character vector specifing which fields to check for possible duplication. Default value is null, and no fields are checked for duplicates

reactiveData

Reactive which stores all of the tables from the database as seperate data.frames

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.