mirror of
https://github.com/agdamsbo/FreesearchR.git
synced 2025-12-16 01:22:10 +01:00
feat: updated operators for creating new variables
This commit is contained in:
parent
f4f433ee84
commit
30f13c7232
1 changed files with 27 additions and 18 deletions
|
|
@ -26,9 +26,9 @@ create_column_ui <- function(id) {
|
||||||
htmltools::tagList(
|
htmltools::tagList(
|
||||||
# datamods:::html_dependency_datamods(),
|
# datamods:::html_dependency_datamods(),
|
||||||
# html_dependency_FreesearchR(),
|
# html_dependency_FreesearchR(),
|
||||||
shiny::tags$head(
|
shiny::tags$head(
|
||||||
shiny::tags$link(rel = "stylesheet", type = "text/css", href = "FreesearchR/inst/assets/css/FreesearchR.css")
|
shiny::tags$link(rel = "stylesheet", type = "text/css", href = "FreesearchR/inst/assets/css/FreesearchR.css")
|
||||||
),
|
),
|
||||||
fluidRow(
|
fluidRow(
|
||||||
column(
|
column(
|
||||||
width = 6,
|
width = 6,
|
||||||
|
|
@ -184,35 +184,44 @@ create_column_server <- function(id,
|
||||||
#'
|
#'
|
||||||
#' @rdname create-column
|
#' @rdname create-column
|
||||||
# @importFrom methods getGroupMembers
|
# @importFrom methods getGroupMembers
|
||||||
list_allowed_operations <- function() {
|
allowed_operations <- function() {
|
||||||
c(
|
list(
|
||||||
"(", "c",
|
"Misc" = c("(", "c",":","~"),
|
||||||
# getGroupMembers("Arith"),
|
# getGroupMembers("Arith"),
|
||||||
c("+", "-", "*", "^", "%%", "%/%", "/"),
|
"Arithmetics" = c("+", "-", "*", "^", "%%", "%/%", "/"),
|
||||||
# getGroupMembers("Compare"),
|
# getGroupMembers("Compare"),
|
||||||
c("==", ">", "<", "!=", "<=", ">="),
|
"Compare" = c("==", ">", "<", "!=", "<=", ">="),
|
||||||
# getGroupMembers("Logic"),
|
# getGroupMembers("Logic"),
|
||||||
c("&", "|"),
|
"Logic" = c("&", "|", "is.na", "ifelse", "any", "all"),
|
||||||
# getGroupMembers("Math"),
|
# getGroupMembers("Math"),
|
||||||
c(
|
"Math" = c(
|
||||||
"abs", "sign", "sqrt", "ceiling", "floor", "trunc", "cummax",
|
"abs", "sign", "sqrt", "ceiling", "floor", "trunc", "cummax",
|
||||||
"cummin", "cumprod", "cumsum", "exp", "expm1", "log", "log10",
|
"cummin", "cumprod", "cumsum", "exp", "expm1", "log", "log10",
|
||||||
"log2", "log1p", "cos", "cosh", "sin", "sinh", "tan", "tanh",
|
"log2", "log1p", "cos", "cosh", "sin", "sinh", "tan", "tanh",
|
||||||
"acos", "acosh", "asin", "asinh", "atan", "atanh", "cospi", "sinpi",
|
"acos", "acosh", "asin", "asinh", "atan", "atanh", "cospi", "sinpi",
|
||||||
"tanpi", "gamma", "lgamma", "digamma", "trigamma"
|
"tanpi", "gamma", "lgamma", "digamma", "trigamma", "round", "signif"
|
||||||
),
|
),
|
||||||
# getGroupMembers("Math2"),
|
# getGroupMembers("Math2"),
|
||||||
c("round", "signif"),
|
# c("round", "signif"),
|
||||||
# getGroupMembers("Summary"),
|
# getGroupMembers("Summary"),
|
||||||
c("max", "min", "range", "prod", "sum", "any", "all"),
|
"Summary" = c(
|
||||||
"pmin", "pmax", "mean",
|
"max", "min", "range", "prod", "sum", "length",
|
||||||
"paste", "paste0", "substr", "nchar", "trimws",
|
"pmin", "pmax", "mean"
|
||||||
"gsub", "sub", "grepl", "ifelse", "length",
|
),
|
||||||
"as.numeric", "as.character", "as.integer", "as.Date", "as.POSIXct",
|
"Text" = c(
|
||||||
"as.factor", "factor"
|
"paste", "paste0", "substr", "nchar", "trimws",
|
||||||
|
"gsub", "sub", "grepl"
|
||||||
|
),
|
||||||
|
"Class" = c(
|
||||||
|
"as.numeric", "as.character", "as.integer", "as.Date", "as.POSIXct",
|
||||||
|
"as.factor", "factor"
|
||||||
|
)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
list_allowed_operations <- function(data=allowed_operations()) {
|
||||||
|
Reduce(c,data)
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
#' @inheritParams shiny::modalDialog
|
#' @inheritParams shiny::modalDialog
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue