knitr::opts_chunk$set( collapse = TRUE, comment = "#>", fig.path = "man/figures/README-", out.width = "100%" )
Shiny modules to import and manipulate data into an application or addin.
This package provides custom shiny modules to import data from various sources, select, rename and convert variables in a dataset and validate content with validate package.
The modules can be used in any standard shiny application or RStudio add-in.
i18n_flag <- function(code, language) { code <- strsplit(code, split = "|", fixed = TRUE)[[1]] flag <- sprintf("<img src=\"man/figures/i18n/%s.svg\" height=\"16\" style=\"height:16px\"/>", code) paste(paste(flag, collapse = ""), language) } i18n_flags <- function(languages) { mapply( FUN = i18n_flag, code = names(languages), language = unlist(languages, use.names = FALSE), USE.NAMES = FALSE ) } languages <- list( gb = "english (default)", fr = "french", mk = "macedonian", "br|pt" = "brazilian portuguese", al = "albanian", cn = "chinese", es = "spanish", de = "german", tr = "turkish", kr = "korean", pl = "polish", ja = "japanese" )
Currently you can use {datamods} in the following language: r i18n_flags(languages)
.
If you want another language to be supported, you can submit a Pull Request to add a CSV file like the one used for french (file is located in inst/i18n
folder in the package, you can see it here on GitHub).
See the online vignette for more on this topic.
Install from CRAN with:
install.packages("datamods")
You can install the development version of datamods from GitHub with:
remotes::install_github("dreamRs/datamods")
Import data from:
Each module is available in the form import_file_ui()
/ import_file_server()
and can be use independently.
Or all modules can be launched together in a modal window via import_modal()
/ import_server()
:
This module also allow to view imported data and to update variables.
Module update_variables_ui()
/ update_variables_server()
allow to:
Define some validation rules with package validate and check whether data lives up to those expectations.
Interactively filter a data.frame
, this module also generates the code to reproduce the filters.
This module extracts a sample from a data.frame
, based either on a fixed number of rows or on a percentage of total rows.
This module makes a data.frame
editable, allowing the user to add, modify or delete rows.
This module allow to enter an expression to create a new column in a data.frame
.
This module contain an interface to cut a numeric into several intervals.
This module contain an interface to reorder the levels of a factor variable.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.