This module allow to enter an expression to create a new column in a data.frame
.
Usage
create_column_ui(id)
create_column_server(
id,
data_r = reactive(NULL),
allowed_operations = list_allowed_operations()
)
list_allowed_operations()
modal_create_column(
id,
title = i18n("Create a new column"),
easyClose = TRUE,
size = "l",
footer = NULL
)
winbox_create_column(
id,
title = i18n("Create a new column"),
options = shinyWidgets::wbOptions(),
controls = shinyWidgets::wbControls()
)
Arguments
- id
Module's ID.
- data_r
A
shiny::reactive()
function returning adata.frame
.- allowed_operations
A
list
of allowed operations, see below for details.- title
An optional title for the dialog.
- easyClose
If
TRUE
, the modal dialog can be dismissed by clicking outside the dialog box, or be pressing the Escape key. IfFALSE
(the default), the modal dialog can't be dismissed in those ways; instead it must be dismissed by clicking on amodalButton()
, or from a call toremoveModal()
on the server.- size
One of
"s"
for small,"m"
(the default) for medium,"l"
for large, or"xl"
for extra large. Note that"xl"
only works with Bootstrap 4 and above (to opt-in to Bootstrap 4+, passbslib::bs_theme()
to thetheme
argument of a page container likefluidPage()
).UI for footer. Use
NULL
for no footer.- options
List of options, see
wbOptions()
.- controls
List of controls, see
wbControls()
.
Value
A shiny::reactive()
function returning the data.
Note
User can only use a subset of function: (, c, +, -, *, ^, %%, %/%, /, ==, >, <, !=, <=, >=, &, |, abs, sign, sqrt, ceiling, floor, trunc, cummax, cummin, cumprod, cumsum, exp, expm1, log, log10, log2, log1p, cos, cosh, sin, sinh, tan, tanh, acos, acosh, asin, asinh, atan, atanh, cospi, sinpi, tanpi, gamma, lgamma, digamma, trigamma, round, signif, max, min, range, prod, sum, any, all, pmin, pmax, mean, paste, paste0, substr, nchar, trimws, gsub, sub, grepl, ifelse, length, as.numeric, as.character, as.integer, as.Date, as.POSIXct, as.factor, factor.
You can add more operations using the allowed_operations
argument, for example if you want to allow to use package lubridate, you can do:
c(list_allowed_operations(), getNamespaceExports("lubridate"))