README.md

Shiny CSV Import

Lifecycle:
experimental

This package provides an R Shiny module with the functionality needed to import CSV files into a Shiny app. Users can change the most important settings:

The calling app can set a default of these options, too. Additionally, it can specify in detail which columns it expects including their name and format.

Features

The module has three modes: as-is, desired, and user-defined.

Example

Once you have downloaded the package, you can run an example app:

In your R console:

shiny.CSVImport::runExample()

Usage

UI

In the UI part of your app you should call the ModuleImportUI function using a name space id of your choice (here “ProjectDataFile”).

For example:

ui <- fluidPage(
    title = "CSV Import Sample App",

    ModuleImportUI("ProjectDataFile"),

    h3("Example App Preview"),
    tableOutput("AppOutputTest")
  )

User Interface of the Shiny CSV
Module

Server

You can access to the input’s value in the server side by calling the module using the corresponding name space id (here “ProjectDataFile”):

server <- function(input,output,session) {

    DataFile <- ModuleImportServer("ProjectDataFile", UiLng = "en")

    output$AppOutputTest <- renderTable({
      need(DataFile(), "No data available")
      return(DataFile())
    })
}

Terms: DSV vs. CSV

In a strict sense this package supports Delimiter-Separated Values (DSV) rather than CSV. CSV implies fields separated by commas, double quotes used to escape commas, and no continuation lines (RFC 4180, Raymond, 2003). It seemed to the author that in everyday language the CSV is not limited to files using these specifications, anymore. That may be imprecise but it just shows how language evolves without caring much about definitions. To increase chances to be found the package is named after the CSV format.

Installation

To install this package, the easiest is to directly install the package from GitHub:

In your R console:

install.package("devtools")
devtools::install_github("SigurdJanson/shinyCSVImpoMod")

Once the package is installed, start using it:

In your R console:

library(shiny.CSVImport)
help(package=shiny.CSVImport)

Issues

When encountering a problem with the package, you can report issues on GitHub directly here.

Contributing

You can contribute in various ways. I would appreciate any help with new translations. Here are all chances to contribute:

Citation

I invest some time and effort to create this package. Please cite it when using it:

In your R console:

citation("shiny.CSVImport")

See also citation() for citing R itself.

Known Limitations

References

Twitter
URL



SigurdJanson/shinyCSVImpoMod documentation built on Jan. 5, 2023, 3:57 a.m.