R/importFilesInput.R

Defines functions importFilesInput

Documented in importFilesInput

#' Shiny ui module for data importation.
#' @param id ID of the importation module.
#' @param label Label of the importation module.
#' @return User selections for data importation.
#' @importFrom shiny tagList
#' @importFrom shiny fileInput
#' @importFrom shiny textInput
#' @importFrom shiny NS
#' @export


importFilesInput <- function(id, label = "File") {
  # Create a namespace function using the provided id
  ns <- NS(id)
  
  tagList(
      selectInput(
        ns("filetype"),
        "What type of file do you import",
        choices = c("csv", "excel", "google", "bibtex", "text"),
        selected = "csv"
      ),
      fileInput(
        ns("paths"),
        label = "Select the file(s) to import.",
        accept = c(".csv",".xlsx",".bib",".txt"),
        multiple = TRUE
      ),
      textInput(
        ns("google"),
        label = "Indicate the names of the google files",
        value = "Not relevant"
      ),
      textInput(
        ns("spreadsheet"),
        label = "Indicate the name of the spreadsheet",
        value = "Not relevant"
      )
    )
}
NicolasJBM/datexp documentation built on May 14, 2019, 10:36 a.m.