R/golem_utils_ui.R

Defines functions input_separator file_upload

########################
#### golem_utils ui ####
########################

#This holds functions that are used in the module uploadData ui

#function to upload a file. file_id is the id assigned to the file. file_label 
#is the label assigned to the file as visible in the ui
file_upload <- function(file_id, file_label) {
  fileInput(file_id,
            file_label,
            multiple = FALSE,
            accept = c("text/csv",
                       "text/comma-separated-values,text/plain",
                       ".csv",
                       ".tsv"))
  }

#function which holds the type of input separators. file_id is the id assigned 
#to the file. file_label is the label assigned to the file as visible in the ui
input_separator <- function(file_id, file_label) {
  radioButtons(file_id,
               file_label,
               choices = c(Comma = ",",
                           Tab = "\t"),
               selected = "\t")
}
jennahamlin/Tinsel documentation built on Sept. 15, 2021, 9:46 a.m.