#' Shiny server module for data importation.
#' @param input List. User input
#' @param output List. Output to be displayed.
#' @param session List. Global options.
#' @param stringsAsFactors Logical. Option for strings importantion.
#' @return Importation.
#' @importFrom shiny reactive
#' @importFrom shiny validate
#' @importFrom shiny need
#' @importFrom stringr str_split
#' @export
importFiles <- function(input, output, session, stringsAsFactors) {
filetype <- reactive({
validate(need(input$filetype, message = FALSE))
input$filetype
})
paths <- reactive({
validate(need(input$paths, message = FALSE))
input$paths
})
google <- reactive({
validate(need(input$google, message = FALSE))
input$google
})
spreadsheet <- reactive({
validate(need(input$spreadsheet, message = FALSE))
input$spreadsheet
})
concatenation <- reactive({
filetype <- filetype()
paths <- paths()
google <- google()
spreadsheet<- spreadsheet()
if(filetype == "google") {
paths <- str_split(google, " ")[[1]]
} else {
paths <- paths
}
concatenation <- datexp_import(
x = paths,
spreadsheet = spreadsheet,
filetype = filetype
)
})
return(concatenation)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.