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.
The module has three modes: as-is, desired, and user-defined.
Once you have downloaded the package, you can run an example app:
In your R
console:
shiny.CSVImport::runExample()
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")
)
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())
})
}
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.
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)
When encountering a problem with the package, you can report issues on GitHub directly here.
You can contribute in various ways. I would appreciate any help with new translations. Here are all chances to contribute:
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.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.