mod_loading_optionsInput: mod_loading_optionsInput and mod_loading_options

Description Usage Arguments Examples

Description

A shiny module that read a delimited file (with read_delim) from a path and a filename. It is more a internal module than a module that works on itself.

Usage

1
2
3
4
mod_loading_optionsInput(id)

mod_loading_options(input, output, session, path, filename,
  coltypes = cols(.default = col_character()))

Arguments

id

shiny id

input

internal

output

internal

session

inernal

path

reactive string value. The path to the directory where the file is

filename

reactive string value. Name and extension of the file to read

coltypes

see col_types argument in read_delim

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
library(shiny)
if (interactive()) {
ui <- fluidPage(
  h4("Choose a path"),
  textInput("path", value = getwd(), label = NULL),
  h4("Choose a filename (do not forget the extension)"),
  textInput("filename", value = "", label = NULL),
  h4("The module goes from here............................"),
  mod_loading_optionsInput("loadfile"),
  h4("..........................................to here"),
  h4("You can display the result"),
  tableOutput("data")
)

server <- function(input, output, session) {
  data <- callModule(mod_loading_options,"loadfile", path = reactive(input$path), 
  filename = reactive(input$filename))
  output$data <- renderTable(data())
}

shinyApp(ui, server)
}

BenjaminLouis/manageR documentation built on May 8, 2019, 12:50 p.m.