diff --git a/NEWS.md b/NEWS.md index 5fe1d25..efa9f04 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,6 +1,7 @@ # datamods 1.4.6 * New module `create_column_ui()` / `create_column_server()` to add new column based on an expression to a `data.frame`. +* New module `cut_variable_ui()` / `cut_variable_server()` to cut a numeric factor into several interval. # datamods 1.4.5 diff --git a/R/create-column.R b/R/create-column.R index 32c245f..650a2fe 100644 --- a/R/create-column.R +++ b/R/create-column.R @@ -190,7 +190,9 @@ list_allowed_operations <- function() { c("max", "min", "range", "prod", "sum", "any", "all"), "pmin", "pmax", "mean", "paste", "paste0", "substr", "nchar", "trimws", - "gsub", "sub", "grepl", "ifelse" + "gsub", "sub", "grepl", "ifelse", "length", + "as.numeric", "as.character", "as.integer", "as.Date", "as.POSIXct", + "as.factor", "factor" ) } diff --git a/man/create-column.Rd b/man/create-column.Rd index 838bb66..c3f47b8 100644 --- a/man/create-column.Rd +++ b/man/create-column.Rd @@ -56,7 +56,7 @@ A \code{\link[shiny:reactive]{shiny::reactive()}} function returning the data. This module allow to enter an expression to create a new column in \code{data.frame}. } \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. +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 \code{allowed_operations} argument, for example if you want to allow to use package lubridate, you can do: \if{html}{\out{