mirror of
https://github.com/agdamsbo/FreesearchR.git
synced 2025-09-12 09:59:39 +02:00
This commit is contained in:
parent
9ae7cc2d03
commit
268038e49e
5 changed files with 36 additions and 32 deletions
|
@ -1 +1 @@
|
||||||
app_version <- function()'250313_1343'
|
app_version <- function()'250313_1502'
|
||||||
|
|
|
@ -13,7 +13,7 @@ library(rlang)
|
||||||
#'
|
#'
|
||||||
#' @name update-variables
|
#' @name update-variables
|
||||||
#'
|
#'
|
||||||
update_variables_ui <- function(id, title = TRUE) {
|
update_variables_ui <- function(id, title = "") {
|
||||||
ns <- NS(id)
|
ns <- NS(id)
|
||||||
if (isTRUE(title)) {
|
if (isTRUE(title)) {
|
||||||
title <- htmltools::tags$h4(
|
title <- htmltools::tags$h4(
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
#### Current file: R//app_version.R
|
#### Current file: R//app_version.R
|
||||||
########
|
########
|
||||||
|
|
||||||
app_version <- function()'250313_1343'
|
app_version <- function()'250313_1502'
|
||||||
|
|
||||||
|
|
||||||
########
|
########
|
||||||
|
@ -5795,7 +5795,7 @@ library(rlang)
|
||||||
#'
|
#'
|
||||||
#' @name update-variables
|
#' @name update-variables
|
||||||
#'
|
#'
|
||||||
update_variables_ui <- function(id, title = TRUE) {
|
update_variables_ui <- function(id, title = "") {
|
||||||
ns <- NS(id)
|
ns <- NS(id)
|
||||||
if (isTRUE(title)) {
|
if (isTRUE(title)) {
|
||||||
title <- htmltools::tags$h4(
|
title <- htmltools::tags$h4(
|
||||||
|
@ -6895,9 +6895,7 @@ ui_elements <- list(
|
||||||
fluidRow(
|
fluidRow(
|
||||||
shiny::column(
|
shiny::column(
|
||||||
width = 9,
|
width = 9,
|
||||||
shiny::tags$p(shiny::markdown("Below, you can subset the data (select variables to include on clicking 'Apply changes'), rename variables, set new labels (for nicer tables in the report) and change variable classes (numeric, factor/categorical etc.).
|
shiny::tags$p(shiny::markdown("Below, are several options to update variables (rename, set new labels (for nicer tables in the report) and change variable classes (numeric, factor/categorical etc.).), modify factor/categorical variables as well as create new factor from a continous variable or new variables with *R* code."))
|
||||||
Italic text can be edited/changed.
|
|
||||||
On the right, you can create and modify factor/categorical variables as well as create new variables with *R* code."))
|
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
shiny::tags$br(),
|
shiny::tags$br(),
|
||||||
|
@ -6911,7 +6909,7 @@ ui_elements <- list(
|
||||||
fluidRow(
|
fluidRow(
|
||||||
shiny::column(
|
shiny::column(
|
||||||
width = 6,
|
width = 6,
|
||||||
tags$h4("Update variables"),
|
tags$h4("Update or modify variables"),
|
||||||
shiny::tags$br(),
|
shiny::tags$br(),
|
||||||
shiny::actionButton(
|
shiny::actionButton(
|
||||||
inputId = "modal_variables",
|
inputId = "modal_variables",
|
||||||
|
@ -6938,11 +6936,11 @@ ui_elements <- list(
|
||||||
shiny::tags$br(),
|
shiny::tags$br(),
|
||||||
shiny::actionButton(
|
shiny::actionButton(
|
||||||
inputId = "modal_cut",
|
inputId = "modal_cut",
|
||||||
label = "Create factor variable",
|
label = "New factor",
|
||||||
width = "100%"
|
width = "100%"
|
||||||
),
|
),
|
||||||
shiny::tags$br(),
|
shiny::tags$br(),
|
||||||
shiny::helpText("Create factor/categorical variable from an other value."),
|
shiny::helpText("Create factor/categorical variable from a continous variable (number/date/time)."),
|
||||||
shiny::tags$br(),
|
shiny::tags$br(),
|
||||||
shiny::tags$br(),
|
shiny::tags$br(),
|
||||||
shiny::actionButton(
|
shiny::actionButton(
|
||||||
|
@ -7537,7 +7535,7 @@ server <- function(input, output, session) {
|
||||||
label = "Select variables to include",
|
label = "Select variables to include",
|
||||||
selected = preselect,
|
selected = preselect,
|
||||||
choices = names(rv$data_temp),
|
choices = names(rv$data_temp),
|
||||||
updateOn = "close",
|
updateOn = "change",
|
||||||
multiple = TRUE,
|
multiple = TRUE,
|
||||||
search = TRUE,
|
search = TRUE,
|
||||||
showValueAsTags = TRUE
|
showValueAsTags = TRUE
|
||||||
|
@ -7633,7 +7631,7 @@ server <- function(input, output, session) {
|
||||||
|
|
||||||
shiny::observeEvent(
|
shiny::observeEvent(
|
||||||
input$modal_variables,
|
input$modal_variables,
|
||||||
modal_update_variables("modal_variables", title = "Modify factor levels")
|
modal_update_variables("modal_variables", title = "Update and select variables")
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
@ -7641,7 +7639,7 @@ server <- function(input, output, session) {
|
||||||
|
|
||||||
shiny::observeEvent(
|
shiny::observeEvent(
|
||||||
input$modal_cut,
|
input$modal_cut,
|
||||||
modal_cut_variable("modal_cut", title = "Modify factor levels")
|
modal_cut_variable("modal_cut", title = "Create new factor")
|
||||||
)
|
)
|
||||||
|
|
||||||
data_modal_cut <- cut_variable_server(
|
data_modal_cut <- cut_variable_server(
|
||||||
|
@ -7655,7 +7653,7 @@ server <- function(input, output, session) {
|
||||||
|
|
||||||
shiny::observeEvent(
|
shiny::observeEvent(
|
||||||
input$modal_update,
|
input$modal_update,
|
||||||
datamods::modal_update_factor(id = "modal_update")
|
datamods::modal_update_factor(id = "modal_update", title = "Reorder factor levels")
|
||||||
)
|
)
|
||||||
|
|
||||||
data_modal_update <- datamods::update_factor_server(
|
data_modal_update <- datamods::update_factor_server(
|
||||||
|
@ -7672,7 +7670,11 @@ server <- function(input, output, session) {
|
||||||
|
|
||||||
shiny::observeEvent(
|
shiny::observeEvent(
|
||||||
input$modal_column,
|
input$modal_column,
|
||||||
datamods::modal_create_column(id = "modal_column", footer = "This is only for advanced users!")
|
datamods::modal_create_column(
|
||||||
|
id = "modal_column",
|
||||||
|
footer = "This window is aimed at advanced users and require some R-experience!",
|
||||||
|
title = "Create new variables"
|
||||||
|
)
|
||||||
)
|
)
|
||||||
data_modal_r <- datamods::create_column_server(
|
data_modal_r <- datamods::create_column_server(
|
||||||
id = "modal_column",
|
id = "modal_column",
|
||||||
|
@ -7934,8 +7936,8 @@ server <- function(input, output, session) {
|
||||||
data_filter(),
|
data_filter(),
|
||||||
input$strat_var,
|
input$strat_var,
|
||||||
input$include_vars,
|
input$include_vars,
|
||||||
input$add_p,
|
input$complete_cutoff,
|
||||||
input$complete_cutoff
|
input$add_p
|
||||||
),
|
),
|
||||||
{
|
{
|
||||||
shiny::req(input$strat_var)
|
shiny::req(input$strat_var)
|
||||||
|
@ -8004,7 +8006,7 @@ server <- function(input, output, session) {
|
||||||
data = shiny::reactive({
|
data = shiny::reactive({
|
||||||
shiny::req(rv$list$data)
|
shiny::req(rv$list$data)
|
||||||
out <- rv$list$data
|
out <- rv$list$data
|
||||||
if (!is.null(input$outcome_var_cor) && input$outcome_var_cor!="none"){
|
if (!is.null(input$outcome_var_cor) && input$outcome_var_cor != "none") {
|
||||||
out <- out[!names(out) %in% input$outcome_var_cor]
|
out <- out[!names(out) %in% input$outcome_var_cor]
|
||||||
}
|
}
|
||||||
out
|
out
|
||||||
|
|
|
@ -176,7 +176,7 @@ server <- function(input, output, session) {
|
||||||
label = "Select variables to include",
|
label = "Select variables to include",
|
||||||
selected = preselect,
|
selected = preselect,
|
||||||
choices = names(rv$data_temp),
|
choices = names(rv$data_temp),
|
||||||
updateOn = "close",
|
updateOn = "change",
|
||||||
multiple = TRUE,
|
multiple = TRUE,
|
||||||
search = TRUE,
|
search = TRUE,
|
||||||
showValueAsTags = TRUE
|
showValueAsTags = TRUE
|
||||||
|
@ -272,7 +272,7 @@ server <- function(input, output, session) {
|
||||||
|
|
||||||
shiny::observeEvent(
|
shiny::observeEvent(
|
||||||
input$modal_variables,
|
input$modal_variables,
|
||||||
modal_update_variables("modal_variables", title = "Modify factor levels")
|
modal_update_variables("modal_variables", title = "Update and select variables")
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
@ -280,7 +280,7 @@ server <- function(input, output, session) {
|
||||||
|
|
||||||
shiny::observeEvent(
|
shiny::observeEvent(
|
||||||
input$modal_cut,
|
input$modal_cut,
|
||||||
modal_cut_variable("modal_cut", title = "Modify factor levels")
|
modal_cut_variable("modal_cut", title = "Create new factor")
|
||||||
)
|
)
|
||||||
|
|
||||||
data_modal_cut <- cut_variable_server(
|
data_modal_cut <- cut_variable_server(
|
||||||
|
@ -294,7 +294,7 @@ server <- function(input, output, session) {
|
||||||
|
|
||||||
shiny::observeEvent(
|
shiny::observeEvent(
|
||||||
input$modal_update,
|
input$modal_update,
|
||||||
datamods::modal_update_factor(id = "modal_update")
|
datamods::modal_update_factor(id = "modal_update", title = "Reorder factor levels")
|
||||||
)
|
)
|
||||||
|
|
||||||
data_modal_update <- datamods::update_factor_server(
|
data_modal_update <- datamods::update_factor_server(
|
||||||
|
@ -311,7 +311,11 @@ server <- function(input, output, session) {
|
||||||
|
|
||||||
shiny::observeEvent(
|
shiny::observeEvent(
|
||||||
input$modal_column,
|
input$modal_column,
|
||||||
datamods::modal_create_column(id = "modal_column", footer = "This is only for advanced users!")
|
datamods::modal_create_column(
|
||||||
|
id = "modal_column",
|
||||||
|
footer = "This window is aimed at advanced users and require some R-experience!",
|
||||||
|
title = "Create new variables"
|
||||||
|
)
|
||||||
)
|
)
|
||||||
data_modal_r <- datamods::create_column_server(
|
data_modal_r <- datamods::create_column_server(
|
||||||
id = "modal_column",
|
id = "modal_column",
|
||||||
|
@ -573,8 +577,8 @@ server <- function(input, output, session) {
|
||||||
data_filter(),
|
data_filter(),
|
||||||
input$strat_var,
|
input$strat_var,
|
||||||
input$include_vars,
|
input$include_vars,
|
||||||
input$add_p,
|
input$complete_cutoff,
|
||||||
input$complete_cutoff
|
input$add_p
|
||||||
),
|
),
|
||||||
{
|
{
|
||||||
shiny::req(input$strat_var)
|
shiny::req(input$strat_var)
|
||||||
|
@ -643,7 +647,7 @@ server <- function(input, output, session) {
|
||||||
data = shiny::reactive({
|
data = shiny::reactive({
|
||||||
shiny::req(rv$list$data)
|
shiny::req(rv$list$data)
|
||||||
out <- rv$list$data
|
out <- rv$list$data
|
||||||
if (!is.null(input$outcome_var_cor) && input$outcome_var_cor!="none"){
|
if (!is.null(input$outcome_var_cor) && input$outcome_var_cor != "none") {
|
||||||
out <- out[!names(out) %in% input$outcome_var_cor]
|
out <- out[!names(out) %in% input$outcome_var_cor]
|
||||||
}
|
}
|
||||||
out
|
out
|
||||||
|
|
|
@ -172,9 +172,7 @@ ui_elements <- list(
|
||||||
fluidRow(
|
fluidRow(
|
||||||
shiny::column(
|
shiny::column(
|
||||||
width = 9,
|
width = 9,
|
||||||
shiny::tags$p(shiny::markdown("Below, you can subset the data (select variables to include on clicking 'Apply changes'), rename variables, set new labels (for nicer tables in the report) and change variable classes (numeric, factor/categorical etc.).
|
shiny::tags$p(shiny::markdown("Below, are several options to update variables (rename, set new labels (for nicer tables in the report) and change variable classes (numeric, factor/categorical etc.).), modify factor/categorical variables as well as create new factor from a continous variable or new variables with *R* code."))
|
||||||
Italic text can be edited/changed.
|
|
||||||
On the right, you can create and modify factor/categorical variables as well as create new variables with *R* code."))
|
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
shiny::tags$br(),
|
shiny::tags$br(),
|
||||||
|
@ -188,7 +186,7 @@ ui_elements <- list(
|
||||||
fluidRow(
|
fluidRow(
|
||||||
shiny::column(
|
shiny::column(
|
||||||
width = 6,
|
width = 6,
|
||||||
tags$h4("Update variables"),
|
tags$h4("Update or modify variables"),
|
||||||
shiny::tags$br(),
|
shiny::tags$br(),
|
||||||
shiny::actionButton(
|
shiny::actionButton(
|
||||||
inputId = "modal_variables",
|
inputId = "modal_variables",
|
||||||
|
@ -215,11 +213,11 @@ ui_elements <- list(
|
||||||
shiny::tags$br(),
|
shiny::tags$br(),
|
||||||
shiny::actionButton(
|
shiny::actionButton(
|
||||||
inputId = "modal_cut",
|
inputId = "modal_cut",
|
||||||
label = "Create factor variable",
|
label = "New factor",
|
||||||
width = "100%"
|
width = "100%"
|
||||||
),
|
),
|
||||||
shiny::tags$br(),
|
shiny::tags$br(),
|
||||||
shiny::helpText("Create factor/categorical variable from an other value."),
|
shiny::helpText("Create factor/categorical variable from a continous variable (number/date/time)."),
|
||||||
shiny::tags$br(),
|
shiny::tags$br(),
|
||||||
shiny::tags$br(),
|
shiny::tags$br(),
|
||||||
shiny::actionButton(
|
shiny::actionButton(
|
||||||
|
|
Loading…
Add table
Reference in a new issue