tableEditor
The goal of tableEditor is to provide an interactive data editor.
Notes
The app is still very much experimental and performances are not optimal.
Installation
You can install the development version of tableEditor from GitHub with:
# install.packages("devtools")
devtools::install_github("DivadNojnarg/shiny-edit-data")
Example
This package allows to deploy a data editor in few steps.
- Create a config file
config.yml
:
production
: if FALSE, you are allowed to reset the data by clicking on the reset button (invisible in production). The default data are defined indata_reset
.version
: Metadata displayed in the footer.board_type
: This package assumes data are stored in pins. pins can be hosted locally or on a server. Passlocal
to callboard_local
orconnect
to callboard_connect
. The latter assumes you already have defined aCONNECT_SERVER
andCONNECT_API_KEY
in your environment.pin_name
: Pin name within the board.filter_cols
: Leave empty to edit all columns. All passed columns will be editable.status_ok
,status_review
, …: The app assumes 4 data states. First, data are inOK
state, which means they are unchanged. As soon as someone modifies the data, they becomeIN REVIEW
. The app supports an admin mode, where one can validate or invalidate the changes resulting in 2 other data states, respectivelyACCEPTED
andREJECTED
. Once validated any further change will reset the validation state such that data areIN REVIEW
.
# Below are the supported default items.
production: false
version: 0.1.0
board_type: "local"
pin_name: "<PIN_NAME>"
filter_cols: !expr c()
status_ok: "OK"
status_review: "IN REVIEW"
status_accepted: "ACCEPTED"
status_rejected: "REJECTED"
data_reset: !expr datasets::iris
- Create your data board. The board must be versioned (default to FALSE for local boards), otherwise you won’t be able to see the data diff.
my_board <- board_local(versioned = TRUE)
pin_search(my_board)
pin_delete("my-test-data", board = my_board)
# Will prepare a 15000 rows table (replicate iris 100 times ...)
# Useful to test performances with larger tables.
tableEditor::prepare_data(iris, my_board, "my-test-data")
- Create an
app.R
script starting by the configuration linking.
options("yaml.eval.expr" = TRUE, "app.config.path" = "<PATH_TO_CONFIG>")
tableEditor::run()
- Deploy to a server and enjoy.