content
stringlengths
0
14.9M
filename
stringlengths
44
136
source('helper/ggbox2.R') observeEvent(input$finalok, { num_data <- final_split$train[, sapply(final_split$train, is.numeric)] f_data <- final_split$train[, sapply(final_split$train, is.factor)] if (is.null(dim(f_data))) { k <- final_split$train %>% map(is.factor) %>% unlist() j <- names(which(k == TRUE)) fdata <- tibble::as_data_frame(f_data) colnames(fdata) <- j updateSelectInput(session, inputId = "gbox2_select_x", choices = names(fdata)) } else if (dim(f_data)[2] == 0) { updateSelectInput(session, 'gbox2_select_x', choices = '', selected = '') } else { updateSelectInput(session, 'gbox2_select_x', choices = names(f_data)) } if (is.null(dim(num_data))) { k <- final_split$train %>% map(is.numeric) %>% unlist() j <- names(which(k == TRUE)) numdata <- tibble::as_data_frame(num_data) colnames(numdata) <- j updateSelectInput(session, 'gbox2_select_y', choices = names(numdata), selected = names(numdata)) } else if (ncol(num_data) < 1) { updateSelectInput(session, 'gbox2_select_y', choices = '', selected = '') } else { updateSelectInput(session, 'gbox2_select_y', choices = names(num_data)) } }) observeEvent(input$submit_part_train_per, { num_data <- final_split$train[, sapply(final_split$train, is.numeric)] f_data <- final_split$train[, sapply(final_split$train, is.factor)] if (is.null(dim(f_data))) { k <- final_split$train %>% map(is.factor) %>% unlist() j <- names(which(k == TRUE)) fdata <- tibble::as_data_frame(f_data) colnames(fdata) <- j updateSelectInput(session, inputId = "gbox2_select_x", choices = names(fdata)) } else if (dim(f_data)[2] == 0) { updateSelectInput(session, 'gbox2_select_x', choices = '', selected = '') } else { updateSelectInput(session, 'gbox2_select_x', choices = names(f_data)) } if (is.null(dim(num_data))) { k <- final_split$train %>% map(is.numeric) %>% unlist() j <- names(which(k == TRUE)) numdata <- tibble::as_data_frame(num_data) colnames(numdata) <- j updateSelectInput(session, 'gbox2_select_y', choices = names(numdata), selected = names(numdata)) } else if (ncol(num_data) < 1) { updateSelectInput(session, 'gbox2_select_y', choices = '', selected = '') } else { updateSelectInput(session, 'gbox2_select_y', choices = names(num_data)) } }) gselectedbox2 <- reactive({ req(input$gbox2_select_x) out <- final_split$train %>% select(input$gbox2_select_x, input$gbox2_select_y) out }) ybox2max <- reactive({ out <- gselectedbox2() %>% select(2) %>% max out }) output$ui_gbox2yrange_min <- renderUI({ df <- final_split$train if (is.null(df)) return(NULL) numericInput('gbox2y_range_min', 'Y Axis Min', value = 0, min = 0) }) output$ui_gbox2yrange_max <- renderUI({ df <- final_split$train if (is.null(df)) return(NULL) numericInput('gbox2y_range_max', 'Y Axis Max', value = ybox2max()) }) output$gbox2_plot_1 <- renderPlot({ ggbox2(data = final_split$train, x = input$gbox2_select_x, y = input$gbox2_select_y, horizontal = input$gbox2_horiz, notch = input$gbox2_notch, title = input$gbox2_title, sub = input$gbox2_subtitle, xlab = input$gbox2_xlabel, ylab = input$gbox2_ylabel, fill = input$gbox2_fill, col = input$gbox2_col) }) output$gbox2_plot_2 <- renderPlot({ ggbox2(data = final_split$train, x = input$gbox2_select_x, y = input$gbox2_select_y, horizontal = input$gbox2_horiz, notch = input$gbox2_notch, title = input$gbox2_title, sub = input$gbox2_subtitle, xlab = input$gbox2_xlabel, ylab = input$gbox2_ylabel, fill = input$gbox2_fill, col = input$gbox2_col, o_col = input$gbox2_ocol, o_fill = input$gbox2_ofill, o_shape = input$gbox2_oshape, o_alpha = input$gbox2_oalpha, o_size = input$gbox2_osize) }) output$gbox2_plot_3<- renderPlot({ ggbox2(data = final_split$train, x = input$gbox2_select_x, y = input$gbox2_select_y, horizontal = input$gbox2_horiz, notch = input$gbox2_notch, title = input$gbox2_title, sub = input$gbox2_subtitle, xlab = input$gbox2_xlabel, ylab = input$gbox2_ylabel, fill = input$gbox2_fill, col = input$gbox2_col, o_col = input$gbox2_ocol, o_fill = input$gbox2_ofill, o_shape = input$gbox2_oshape, o_alpha = input$gbox2_oalpha, o_size = input$gbox2_osize, add_jitter = input$gbox2_jitter, j_width = input$gbox2_jwidth, j_height = input$gbox2_jheight, j_fill = input$gbox2_jfill, j_col = input$gbox2_jcol, j_shape = input$gbox2_jshape, j_size = input$gbox2_jsize, j_alpha = input$gbox2_jalpha) }) output$gbox2_plot_4<- renderPlot({ ggbox2(data = final_split$train, x = input$gbox2_select_x, y = input$gbox2_select_y, horizontal = input$gbox2_horiz, notch = input$gbox2_notch, title = input$gbox2_title, sub = input$gbox2_subtitle, xlab = input$gbox2_xlabel, ylab = input$gbox2_ylabel, fill = input$gbox2_fill, col = input$gbox2_col, o_col = input$gbox2_ocol, o_fill = input$gbox2_ofill, o_shape = input$gbox2_oshape, o_alpha = input$gbox2_oalpha, o_size = input$gbox2_osize, add_jitter = input$gbox2_jitter, j_width = input$gbox2_jwidth, j_height = input$gbox2_jheight, j_fill = input$gbox2_jfill, j_col = input$gbox2_jcol, j_shape = input$gbox2_jshape, j_size = input$gbox2_jsize, j_alpha = input$gbox2_jalpha, yaxlimit = TRUE, y1 = input$gbox2y_range_min, y2 = input$gbox2y_range_max, remove_xax = input$gbox2_remx, remove_yax = input$gbox2_remy) }) output$gbox2_plot_5<- renderPlot({ ggbox2(data = final_split$train, x = input$gbox2_select_x, y = input$gbox2_select_y, horizontal = input$gbox2_horiz, notch = input$gbox2_notch, title = input$gbox2_title, sub = input$gbox2_subtitle, xlab = input$gbox2_xlabel, ylab = input$gbox2_ylabel, fill = input$gbox2_fill, col = input$gbox2_col, o_col = input$gbox2_ocol, o_fill = input$gbox2_ofill, o_shape = input$gbox2_oshape, o_alpha = input$gbox2_oalpha, o_size = input$gbox2_osize, add_jitter = input$gbox2_jitter, j_width = input$gbox2_jwidth, j_height = input$gbox2_jheight, j_fill = input$gbox2_jfill, j_col = input$gbox2_jcol, j_shape = input$gbox2_jshape, j_size = input$gbox2_jsize, j_alpha = input$gbox2_jalpha, yaxlimit = TRUE, y1 = input$gbox2y_range_min, y2 = input$gbox2y_range_max, remove_xax = input$gbox2_remx, remove_yax = input$gbox2_remy, add_text = input$gbox2_text, xloc = input$gbox2_text_x_loc, yloc = input$gbox2_text_y_loc, label = input$gbox2_plottext, tex_color = input$gbox2_textcolor, tex_size = input$gbox2_textsize) }) output$gbox2_plot_6<- renderPlot({ ggbox2(data = final_split$train, x = input$gbox2_select_x, y = input$gbox2_select_y, horizontal = input$gbox2_horiz, notch = input$gbox2_notch, title = input$gbox2_title, sub = input$gbox2_subtitle, xlab = input$gbox2_xlabel, ylab = input$gbox2_ylabel, fill = input$gbox2_fill, col = input$gbox2_col, o_col = input$gbox2_ocol, o_fill = input$gbox2_ofill, o_shape = input$gbox2_oshape, o_alpha = input$gbox2_oalpha, o_size = input$gbox2_osize, add_jitter = input$gbox2_jitter, j_width = input$gbox2_jwidth, j_height = input$gbox2_jheight, j_fill = input$gbox2_jfill, j_col = input$gbox2_jcol, j_shape = input$gbox2_jshape, j_size = input$gbox2_jsize, j_alpha = input$gbox2_jalpha, yaxlimit = TRUE, y1 = input$gbox2y_range_min, y2 = input$gbox2y_range_max, remove_xax = input$gbox2_remx, remove_yax = input$gbox2_remy, add_text = input$gbox2_text, xloc = input$gbox2_text_x_loc, yloc = input$gbox2_text_y_loc, label = input$gbox2_plottext, tex_color = input$gbox2_textcolor, tex_size = input$gbox2_textsize, title_col = input$gbox2_title_col, title_fam = input$gbox2_title_fam, title_face = input$gbox2_title_font, title_size = input$gbox2_title_size, title_hjust = input$gbox2_title_hjust, title_vjust = input$gbox2_title_vjust, sub_col = input$gbox2_sub_col, sub_fam = input$gbox2_sub_fam, sub_face = input$gbox2_subtitle_font, sub_size = input$gbox2_sub_size, sub_hjust = input$gbox2_sub_hjust, sub_vjust = input$gbox2_sub_vjust, xax_col = input$gbox2_xlab_col, xax_fam = input$gbox2_xlab_fam, xax_face = input$gbox2_xlab_font, xax_size = input$gbox2_xlab_size, xax_hjust = input$gbox2_xlab_hjust, xax_vjust = input$gbox2_xlab_vjust, yax_col = input$gbox2_ylab_col, yax_fam = input$gbox2_ylab_fam, yax_face = input$gbox2_ylab_font, yax_size = input$gbox2_ylab_size, yax_hjust = input$gbox2_ylab_hjust, yax_vjust = input$gbox2_ylab_vjust) }) output$gbox2_plot_7<- renderPlot({ ggbox2(data = final_split$train, x = input$gbox2_select_x, y = input$gbox2_select_y, horizontal = input$gbox2_horiz, notch = input$gbox2_notch, title = input$gbox2_title, sub = input$gbox2_subtitle, xlab = input$gbox2_xlabel, ylab = input$gbox2_ylabel, fill = input$gbox2_fill, col = input$gbox2_col, o_col = input$gbox2_ocol, o_fill = input$gbox2_ofill, o_shape = input$gbox2_oshape, o_alpha = input$gbox2_oalpha, o_size = input$gbox2_osize, add_jitter = input$gbox2_jitter, j_width = input$gbox2_jwidth, j_height = input$gbox2_jheight, j_fill = input$gbox2_jfill, j_col = input$gbox2_jcol, j_shape = input$gbox2_jshape, j_size = input$gbox2_jsize, j_alpha = input$gbox2_jalpha, yaxlimit = TRUE, y1 = input$gbox2y_range_min, y2 = input$gbox2y_range_max, remove_xax = input$gbox2_remx, remove_yax = input$gbox2_remy, add_text = input$gbox2_text, xloc = input$gbox2_text_x_loc, yloc = input$gbox2_text_y_loc, label = input$gbox2_plottext, tex_color = input$gbox2_textcolor, tex_size = input$gbox2_textsize, title_col = input$gbox2_title_col, title_fam = input$gbox2_title_fam, title_face = input$gbox2_title_font, title_size = input$gbox2_title_size, title_hjust = input$gbox2_title_hjust, title_vjust = input$gbox2_title_vjust, sub_col = input$gbox2_sub_col, sub_fam = input$gbox2_sub_fam, sub_face = input$gbox2_subtitle_font, sub_size = input$gbox2_sub_size, sub_hjust = input$gbox2_sub_hjust, sub_vjust = input$gbox2_sub_vjust, xax_col = input$gbox2_xlab_col, xax_fam = input$gbox2_xlab_fam, xax_face = input$gbox2_xlab_font, xax_size = input$gbox2_xlab_size, xax_hjust = input$gbox2_xlab_hjust, xax_vjust = input$gbox2_xlab_vjust, yax_col = input$gbox2_ylab_col, yax_fam = input$gbox2_ylab_fam, yax_face = input$gbox2_ylab_font, yax_size = input$gbox2_ylab_size, yax_hjust = input$gbox2_ylab_hjust, yax_vjust = input$gbox2_ylab_vjust, theme = input$gbox2_theme) }) output$gbox2_plot_8<- renderPlot({ ggbox2(data = final_split$train, x = input$gbox2_select_x, y = input$gbox2_select_y, horizontal = input$gbox2_horiz, notch = input$gbox2_notch, title = input$gbox2_title, sub = input$gbox2_subtitle, xlab = input$gbox2_xlabel, ylab = input$gbox2_ylabel, fill = input$gbox2_fill, col = input$gbox2_col, o_col = input$gbox2_ocol, o_fill = input$gbox2_ofill, o_shape = input$gbox2_oshape, o_alpha = input$gbox2_oalpha, o_size = input$gbox2_osize, add_jitter = input$gbox2_jitter, j_width = input$gbox2_jwidth, j_height = input$gbox2_jheight, j_fill = input$gbox2_jfill, j_col = input$gbox2_jcol, j_shape = input$gbox2_jshape, j_size = input$gbox2_jsize, j_alpha = input$gbox2_jalpha, yaxlimit = TRUE, y1 = input$gbox2y_range_min, y2 = input$gbox2y_range_max, remove_xax = input$gbox2_remx, remove_yax = input$gbox2_remy, add_text = input$gbox2_text, xloc = input$gbox2_text_x_loc, yloc = input$gbox2_text_y_loc, label = input$gbox2_plottext, tex_color = input$gbox2_textcolor, tex_size = input$gbox2_textsize, title_col = input$gbox2_title_col, title_fam = input$gbox2_title_fam, title_face = input$gbox2_title_font, title_size = input$gbox2_title_size, title_hjust = input$gbox2_title_hjust, title_vjust = input$gbox2_title_vjust, sub_col = input$gbox2_sub_col, sub_fam = input$gbox2_sub_fam, sub_face = input$gbox2_subtitle_font, sub_size = input$gbox2_sub_size, sub_hjust = input$gbox2_sub_hjust, sub_vjust = input$gbox2_sub_vjust, xax_col = input$gbox2_xlab_col, xax_fam = input$gbox2_xlab_fam, xax_face = input$gbox2_xlab_font, xax_size = input$gbox2_xlab_size, xax_hjust = input$gbox2_xlab_hjust, xax_vjust = input$gbox2_xlab_vjust, yax_col = input$gbox2_ylab_col, yax_fam = input$gbox2_ylab_fam, yax_face = input$gbox2_ylab_font, yax_size = input$gbox2_ylab_size, yax_hjust = input$gbox2_ylab_hjust, yax_vjust = input$gbox2_ylab_vjust, theme = input$gbox2_theme) })
/scratch/gouwar.j/cran-all/cranData/xplorerr/inst/app-visualize/logic/logic_gbox2.R
source('helper/gghist.R') observeEvent(input$finalok, { num_data <- final_split$train[, sapply(final_split$train, is.numeric)] if (is.null(dim(num_data))) { k <- final_split$train %>% map(is.numeric) %>% unlist() j <- names(which(k == TRUE)) numdata <- tibble::as_data_frame(num_data) colnames(numdata) <- j updateSelectInput(session, 'ghist_select_x', choices = names(numdata), selected = names(numdata)) } else if (ncol(num_data) < 1) { updateSelectInput(session, 'ghist_select_x', choices = '', selected = '') } else { updateSelectInput(session, 'ghist_select_x', choices = names(num_data)) } }) observeEvent(input$submit_part_train_per, { num_data <- final_split$train[, sapply(final_split$train, is.numeric)] if (is.null(dim(num_data))) { k <- final_split$train %>% map(is.numeric) %>% unlist() j <- names(which(k == TRUE)) numdata <- tibble::as_data_frame(num_data) colnames(numdata) <- j updateSelectInput(session, 'ghist_select_x', choices = names(numdata), selected = names(numdata)) } else if (ncol(num_data) < 1) { updateSelectInput(session, 'ghist_select_x', choices = '', selected = '') } else { updateSelectInput(session, 'ghist_select_x', choices = names(num_data)) } }) output$ghist_plot_1 <- renderPlot({ gghist(data = final_split$train, x = input$ghist_select_x, bins = input$ghist_bins, title = input$ghist_title, sub = input$ghist_subtitle, xlab = input$ghist_xlabel, ylab = input$ghist_ylabel, fill = input$ghist_fill, col = input$ghist_col) }) output$ghist_plot_2 <- renderPlot({ gghist(data = final_split$train, x = input$ghist_select_x, bins = input$ghist_bins, title = input$ghist_title, sub = input$ghist_subtitle, xlab = input$ghist_xlabel, ylab = input$ghist_ylabel, fill = input$ghist_fill, col = input$ghist_col, remove_xax = input$ghist_remx, remove_yax = input$ghist_remy) }) output$ghist_plot_3 <- renderPlot({ gghist(data = final_split$train, x = input$ghist_select_x, bins = input$ghist_bins, title = input$ghist_title, sub = input$ghist_subtitle, xlab = input$ghist_xlabel, ylab = input$ghist_ylabel, fill = input$ghist_fill, col = input$ghist_col, remove_xax = input$ghist_remx, remove_yax = input$ghist_remy, add_text = input$ghist_text, xloc = input$ghist_text_x_loc, yloc = input$ghist_text_y_loc, label = input$ghist_plottext, tex_color = input$ghist_textcolor, tex_size = input$ghist_textsize) }) output$ghist_plot_4 <- renderPlot({ gghist(data = final_split$train, x = input$ghist_select_x, bins = input$ghist_bins, title = input$ghist_title, sub = input$ghist_subtitle, xlab = input$ghist_xlabel, ylab = input$ghist_ylabel, fill = input$ghist_fill, col = input$ghist_col, remove_xax = input$ghist_remx, remove_yax = input$ghist_remy, add_text = input$ghist_text, xloc = input$ghist_text_x_loc, yloc = input$ghist_text_y_loc, label = input$ghist_plottext, tex_color = input$ghist_textcolor, tex_size = input$ghist_textsize, title_col = input$ghist_title_col, title_fam = input$ghist_title_fam, title_face = input$ghist_title_font, title_size = input$ghist_title_size, title_hjust = input$ghist_title_hjust, title_vjust = input$ghist_title_vjust, sub_col = input$ghist_sub_col, sub_fam = input$ghist_sub_fam, sub_face = input$ghist_subtitle_font, sub_size = input$ghist_sub_size, sub_hjust = input$ghist_sub_hjust, sub_vjust = input$ghist_sub_vjust, xax_col = input$ghist_xlab_col, xax_fam = input$ghist_xlab_fam, xax_face = input$ghist_xlab_font, xax_size = input$ghist_xlab_size, xax_hjust = input$ghist_xlab_hjust, xax_vjust = input$ghist_xlab_vjust, yax_col = input$ghist_ylab_col, yax_fam = input$ghist_ylab_fam, yax_face = input$ghist_ylab_font, yax_size = input$ghist_ylab_size, yax_hjust = input$ghist_ylab_hjust, yax_vjust = input$ghist_ylab_vjust) }) output$ghist_plot_5 <- renderPlot({ gghist(data = final_split$train, x = input$ghist_select_x, bins = input$ghist_bins, title = input$ghist_title, sub = input$ghist_subtitle, xlab = input$ghist_xlabel, ylab = input$ghist_ylabel, fill = input$ghist_fill, col = input$ghist_col, remove_xax = input$ghist_remx, remove_yax = input$ghist_remy, add_text = input$ghist_text, xloc = input$ghist_text_x_loc, yloc = input$ghist_text_y_loc, label = input$ghist_plottext, tex_color = input$ghist_textcolor, tex_size = input$ghist_textsize, title_col = input$ghist_title_col, title_fam = input$ghist_title_fam, title_face = input$ghist_title_font, title_size = input$ghist_title_size, title_hjust = input$ghist_title_hjust, title_vjust = input$ghist_title_vjust, sub_col = input$ghist_sub_col, sub_fam = input$ghist_sub_fam, sub_face = input$ghist_subtitle_font, sub_size = input$ghist_sub_size, sub_hjust = input$ghist_sub_hjust, sub_vjust = input$ghist_sub_vjust, xax_col = input$ghist_xlab_col, xax_fam = input$ghist_xlab_fam, xax_face = input$ghist_xlab_font, xax_size = input$ghist_xlab_size, xax_hjust = input$ghist_xlab_hjust, xax_vjust = input$ghist_xlab_vjust, yax_col = input$ghist_ylab_col, yax_fam = input$ghist_ylab_fam, yax_face = input$ghist_ylab_font, yax_size = input$ghist_ylab_size, yax_hjust = input$ghist_ylab_hjust, yax_vjust = input$ghist_ylab_vjust, theme = input$ghist_theme) }) output$ghist_plot_6 <- renderPlot({ gghist(data = final_split$train, x = input$ghist_select_x, bins = input$ghist_bins, title = input$ghist_title, sub = input$ghist_subtitle, xlab = input$ghist_xlabel, ylab = input$ghist_ylabel, fill = input$ghist_fill, col = input$ghist_col, remove_xax = input$ghist_remx, remove_yax = input$ghist_remy, add_text = input$ghist_text, xloc = input$ghist_text_x_loc, yloc = input$ghist_text_y_loc, label = input$ghist_plottext, tex_color = input$ghist_textcolor, tex_size = input$ghist_textsize, title_col = input$ghist_title_col, title_fam = input$ghist_title_fam, title_face = input$ghist_title_font, title_size = input$ghist_title_size, title_hjust = input$ghist_title_hjust, title_vjust = input$ghist_title_vjust, sub_col = input$ghist_sub_col, sub_fam = input$ghist_sub_fam, sub_face = input$ghist_subtitle_font, sub_size = input$ghist_sub_size, sub_hjust = input$ghist_sub_hjust, sub_vjust = input$ghist_sub_vjust, xax_col = input$ghist_xlab_col, xax_fam = input$ghist_xlab_fam, xax_face = input$ghist_xlab_font, xax_size = input$ghist_xlab_size, xax_hjust = input$ghist_xlab_hjust, xax_vjust = input$ghist_xlab_vjust, yax_col = input$ghist_ylab_col, yax_fam = input$ghist_ylab_fam, yax_face = input$ghist_ylab_font, yax_size = input$ghist_ylab_size, yax_hjust = input$ghist_ylab_hjust, yax_vjust = input$ghist_ylab_vjust, theme = input$ghist_theme) })
/scratch/gouwar.j/cran-all/cranData/xplorerr/inst/app-visualize/logic/logic_ghist.R
source('helper/ggline.R') # out <- eventReactive(input$button_split_no, { # num_data <- cbind.data.frame(final_split$train[, sapply(final_split$train, is.numeric)], # final_split$train[, sapply(final_split$train, is.Date)]) # k <- final_split$train %>% # map(is.numeric) %>% # unlist() # t <- final_split$train %>% # map(is.Date) %>% # unlist() # j1 <- names(which(k == TRUE)) # j2 <- names(which(t == TRUE)) # if (length(j1) == 0) { # j <- j2 # } else if (length(j2) == 0) { # j <- j1 # } else { # j <- c(j1, j2) # } # colnames(num_data) <- j # num_data # }) # output$gline_data <- renderPrint({ # out() # }) observeEvent(input$finalok, { num_data <- cbind.data.frame(final_split$train[, sapply(final_split$train, is.numeric)], final_split$train[, sapply(final_split$train, is.Date)]) k <- final_split$train %>% map(is.numeric) %>% unlist() t <- final_split$train %>% map(is.Date) %>% unlist() j1 <- names(which(k == TRUE)) j2 <- names(which(t == TRUE)) if (length(j1) == 0) { j <- j2 } else if (length(j2) == 0) { j <- j1 } else { j <- c(j1, j2) } colnames(num_data) <- j if (is.null(dim(num_data))) { numdata <- tibble::as_data_frame(num_data) updateSelectInput(session, 'gline_select_x', choices = names(numdata), selected = names(numdata)) updateSelectInput(session, 'gline_y', choices = names(numdata), selected = names(numdata)) } else if (ncol(num_data) < 1) { updateSelectInput(session, 'gline_select_x', choices = '', selected = '') updateSelectInput(session, 'gline_y', choices = '', selected = '') } else { updateSelectInput(session, 'gline_select_x', choices = names(num_data)) updateSelectInput(session, 'gline_y', choices = names(num_data)) } }) observeEvent(input$submit_part_train_per, { num_data <- cbind.data.frame(final_split$train[, sapply(final_split$train, is.numeric)], final_split$train[, sapply(final_split$train, is.Date)]) k <- final_split$train %>% map(is.numeric) %>% unlist() t <- final_split$train %>% map(is.Date) %>% unlist() j1 <- names(which(k == TRUE)) j2 <- names(which(t == TRUE)) if (length(j1) == 0) { j <- j2 } else if (length(j2) == 0) { j <- j1 } else { j <- c(j1, j2) } colnames(num_data) <- j if (is.null(dim(num_data))) { numdata <- tibble::as_data_frame(num_data) updateSelectInput(session, 'gline_select_x', choices = names(numdata), selected = names(numdata)) updateSelectInput(session, 'gline_y', choices = names(numdata), selected = names(numdata)) } else if (ncol(num_data) < 1) { updateSelectInput(session, 'gline_select_x', choices = '', selected = '') updateSelectInput(session, 'gline_y', choices = '', selected = '') } else { updateSelectInput(session, 'gline_select_x', choices = names(num_data)) updateSelectInput(session, 'gline_y', choices = names(num_data)) } }) gselectedline <- reactive({ req(input$gline_select_x) out <- final_split$train %>% select(input$gline_select_x, input$gline_y) out }) ylinemax <- reactive({ out <- gselectedline() %>% select(-1) %>% unlist() %>% max out }) output$ui_glineyrange_min <- renderUI({ df <- final_split$train if (is.null(df)) return(NULL) numericInput('gliney_range_min', 'Y Axis Min', value = 0, min = 0) }) output$ui_glineyrange_max <- renderUI({ df <- final_split$train if (is.null(df)) return(NULL) numericInput('gliney_range_max', 'Y Axis Max', value = ylinemax()) }) output$gline_plot_1 <- renderPlot({ ggline(data = final_split$train, x = input$gline_select_x, columns = input$gline_y, title = input$gbox_title, sub = input$gbox_subtitle, xlab = input$gbox_xlabel, ylab = input$gbox_ylabel) }) # gline2_out <- eventReactive(input$gline2_submit, { # p <- ggline(data = final_split$train, x = input$gline_select_x, # columns = input$gline_y, # title = input$gbox_title, sub = input$gbox_subtitle, # xlab = input$gbox_xlabel, ylab = input$gbox_ylabel, # cols = input$gline_col, alphas = as.numeric(input$gline_alpha), # ltypes = as.numeric(input$gline_ltype), sizes = as.numeric(input$gline_size)) # print(p) # }) # output$gline_plot_2 <- renderPlot({ # ggline(data = final_split$train, x = input$gline_select_x, # columns = input$gline_y, # title = input$gbox_title, sub = input$gbox_subtitle, # xlab = input$gbox_xlabel, ylab = input$gbox_ylabel, # cols = input$gline_col, alphas = as.numeric(input$gline_alpha), # ltypes = as.numeric(input$gline_ltype), sizes = as.numeric(input$gline_size)) # }) output$gline_plot_3 <- renderPlot({ ggline(data = final_split$train, x = input$gline_select_x, columns = input$gline_y, title = input$gbox_title, sub = input$gbox_subtitle, xlab = input$gbox_xlabel, ylab = input$gbox_ylabel, yaxlimit = TRUE, y1 = input$gliney_range_min, y2 = input$gliney_range_max, remove_xax = input$gline_remx, remove_yax = input$gline_remy) }) output$gline_plot_4 <- renderPlot({ ggline(data = final_split$train, x = input$gline_select_x, columns = input$gline_y, title = input$gbox_title, sub = input$gbox_subtitle, xlab = input$gbox_xlabel, ylab = input$gbox_ylabel, yaxlimit = TRUE, y1 = input$gliney_range_min, y2 = input$gliney_range_max, remove_xax = input$gline_remx, remove_yax = input$gline_remy, add_text = input$gline_text, xloc = input$gline_text_x_loc, yloc = input$gline_text_y_loc, label = input$gline_plottext, tex_color = input$gline_textcolor, tex_size = input$gline_textsize) }) output$gline_plot_5 <- renderPlot({ ggline(data = final_split$train, x = input$gline_select_x, columns = input$gline_y, title = input$gbox_title, sub = input$gbox_subtitle, xlab = input$gbox_xlabel, ylab = input$gbox_ylabel, yaxlimit = TRUE, y1 = input$gliney_range_min, y2 = input$gliney_range_max, remove_xax = input$gline_remx, remove_yax = input$gline_remy, add_text = input$gline_text, xloc = input$gline_text_x_loc, yloc = input$gline_text_y_loc, label = input$gline_plottext, tex_color = input$gline_textcolor, tex_size = input$gline_textsize, title_col = input$gline_title_col, title_fam = input$gline_title_fam, title_face = input$gline_title_font, title_size = input$gline_title_size, title_hjust = input$gline_title_hjust, title_vjust = input$gline_title_vjust, sub_col = input$gline_sub_col, sub_fam = input$gline_sub_fam, sub_face = input$gline_subtitle_font, sub_size = input$gline_sub_size, sub_hjust = input$gline_sub_hjust, sub_vjust = input$gline_sub_vjust, xax_col = input$gline_xlab_col, xax_fam = input$gline_xlab_fam, xax_face = input$gline_xlab_font, xax_size = input$gline_xlab_size, xax_hjust = input$gline_xlab_hjust, xax_vjust = input$gline_xlab_vjust, yax_col = input$gline_ylab_col, yax_fam = input$gline_ylab_fam, yax_face = input$gline_ylab_font, yax_size = input$gline_ylab_size, yax_hjust = input$gline_ylab_hjust, yax_vjust = input$gline_ylab_vjust) }) output$gline_plot_6 <- renderPlot({ ggline(data = final_split$train, x = input$gline_select_x, columns = input$gline_y, title = input$gbox_title, sub = input$gbox_subtitle, xlab = input$gbox_xlabel, ylab = input$gbox_ylabel, yaxlimit = TRUE, y1 = input$gliney_range_min, y2 = input$gliney_range_max, remove_xax = input$gline_remx, remove_yax = input$gline_remy, add_text = input$gline_text, xloc = input$gline_text_x_loc, yloc = input$gline_text_y_loc, label = input$gline_plottext, tex_color = input$gline_textcolor, tex_size = input$gline_textsize, title_col = input$gline_title_col, title_fam = input$gline_title_fam, title_face = input$gline_title_font, title_size = input$gline_title_size, title_hjust = input$gline_title_hjust, title_vjust = input$gline_title_vjust, sub_col = input$gline_sub_col, sub_fam = input$gline_sub_fam, sub_face = input$gline_subtitle_font, sub_size = input$gline_sub_size, sub_hjust = input$gline_sub_hjust, sub_vjust = input$gline_sub_vjust, xax_col = input$gline_xlab_col, xax_fam = input$gline_xlab_fam, xax_face = input$gline_xlab_font, xax_size = input$gline_xlab_size, xax_hjust = input$gline_xlab_hjust, xax_vjust = input$gline_xlab_vjust, yax_col = input$gline_ylab_col, yax_fam = input$gline_ylab_fam, yax_face = input$gline_ylab_font, yax_size = input$gline_ylab_size, yax_hjust = input$gline_ylab_hjust, yax_vjust = input$gline_ylab_vjust, theme = input$gline_theme) }) output$gline_plot_7 <- renderPlot({ ggline(data = final_split$train, x = input$gline_select_x, columns = input$gline_y, title = input$gbox_title, sub = input$gbox_subtitle, xlab = input$gbox_xlabel, ylab = input$gbox_ylabel, yaxlimit = TRUE, y1 = input$gliney_range_min, y2 = input$gliney_range_max, remove_xax = input$gline_remx, remove_yax = input$gline_remy, add_text = input$gline_text, xloc = input$gline_text_x_loc, yloc = input$gline_text_y_loc, label = input$gline_plottext, tex_color = input$gline_textcolor, tex_size = input$gline_textsize, title_col = input$gline_title_col, title_fam = input$gline_title_fam, title_face = input$gline_title_font, title_size = input$gline_title_size, title_hjust = input$gline_title_hjust, title_vjust = input$gline_title_vjust, sub_col = input$gline_sub_col, sub_fam = input$gline_sub_fam, sub_face = input$gline_subtitle_font, sub_size = input$gline_sub_size, sub_hjust = input$gline_sub_hjust, sub_vjust = input$gline_sub_vjust, xax_col = input$gline_xlab_col, xax_fam = input$gline_xlab_fam, xax_face = input$gline_xlab_font, xax_size = input$gline_xlab_size, xax_hjust = input$gline_xlab_hjust, xax_vjust = input$gline_xlab_vjust, yax_col = input$gline_ylab_col, yax_fam = input$gline_ylab_fam, yax_face = input$gline_ylab_font, yax_size = input$gline_ylab_size, yax_hjust = input$gline_ylab_hjust, yax_vjust = input$gline_ylab_vjust, theme = input$gline_theme) })
/scratch/gouwar.j/cran-all/cranData/xplorerr/inst/app-visualize/logic/logic_gline.R
source('helper/ggline2.R') observeEvent(input$finalok, { num_data <- cbind.data.frame(final_split$train[, sapply(final_split$train, is.numeric)], final_split$train[, sapply(final_split$train, is.Date)]) k <- final_split$train %>% map(is.numeric) %>% unlist() t <- final_split$train %>% map(is.Date) %>% unlist() j1 <- names(which(k == TRUE)) j2 <- names(which(t == TRUE)) if (length(j1) == 0) { j <- j2 } else if (length(j2) == 0) { j <- j1 } else { j <- c(j1, j2) } colnames(num_data) <- j if (is.null(dim(num_data))) { numdata <- tibble::as_data_frame(num_data) colnames(numdata) <- j updateSelectInput(session, 'gline2_select_x', choices = names(numdata), selected = names(numdata)) updateSelectInput(session, 'gline2_y', choices = names(numdata), selected = names(numdata)) } else if (ncol(num_data) < 1) { updateSelectInput(session, 'gline2_select_x', choices = '', selected = '') updateSelectInput(session, 'gline2_y', choices = '', selected = '') } else { updateSelectInput(session, 'gline2_select_x', choices = names(num_data)) updateSelectInput(session, 'gline2_y', choices = names(num_data)) } f_data <- final_split$train[, sapply(final_split$train, is.factor)] # validate(need(!dim(f_data)[2] == 0, 'No factor variables in the data.')) if (is.null(dim(f_data))) { h <- final_split$train %>% map(is.factor) %>% unlist() q <- names(which(h == TRUE)) fdata <- tibble::as_data_frame(f_data) colnames(fdata) <- q updateSelectInput(session, inputId = "gline2_group", choices = names(fdata)) updateSelectInput(session, inputId = "gline2_col", choices = names(fdata)) updateSelectInput(session, inputId = "gline2_ltype", choices = names(fdata)) updateSelectInput(session, inputId = "gline2_size", choices = names(fdata)) } else if (dim(f_data)[2] == 0) { updateSelectInput(session, 'gline2_group', choices = '', selected = '') updateSelectInput(session, 'gline2_col', choices = '', selected = '') updateSelectInput(session, 'gline2_ltype', choices = '', selected = '') updateSelectInput(session, 'gline2_size', choices = '', selected = '') } else { updateSelectInput(session, 'gline2_group', choices = names(f_data)) updateSelectInput(session, 'gline2_col', choices = names(f_data)) updateSelectInput(session, 'gline2_ltype', choices = names(f_data)) updateSelectInput(session, 'gline2_size', choices = names(f_data)) } }) observeEvent(input$submit_part_train_per, { num_data <- cbind.data.frame(final_split$train[, sapply(final_split$train, is.numeric)], final_split$train[, sapply(final_split$train, is.Date)]) k <- final_split$train %>% map(is.numeric) %>% unlist() t <- final_split$train %>% map(is.Date) %>% unlist() j1 <- names(which(k == TRUE)) j2 <- names(which(t == TRUE)) if (length(j1) == 0) { j <- j2 } else if (length(j2) == 0) { j <- j1 } else { j <- c(j1, j2) } colnames(num_data) <- j if (is.null(dim(num_data))) { numdata <- tibble::as_data_frame(num_data) colnames(numdata) <- j updateSelectInput(session, 'gline2_select_x', choices = names(numdata), selected = names(numdata)) updateSelectInput(session, 'gline2_y', choices = names(numdata), selected = names(numdata)) } else if (ncol(num_data) < 1) { updateSelectInput(session, 'gline2_select_x', choices = '', selected = '') updateSelectInput(session, 'gline2_y', choices = '', selected = '') } else { updateSelectInput(session, 'gline2_select_x', choices = names(num_data)) updateSelectInput(session, 'gline2_y', choices = names(num_data)) } f_data <- final_split$train[, sapply(final_split$train, is.factor)] # validate(need(!dim(f_data)[2] == 0, 'No factor variables in the data.')) if (is.null(dim(f_data))) { h <- final_split$train %>% map(is.factor) %>% unlist() q <- names(which(h == TRUE)) fdata <- tibble::as_data_frame(f_data) colnames(fdata) <- q updateSelectInput(session, inputId = "gline2_group", choices = names(fdata), selected = names(fdata)) updateSelectInput(session, inputId = "gline2_col", choices = names(fdata), selected = names(fdata)) updateSelectInput(session, inputId = "gline2_ltype", choices = names(fdata), selected = names(fdata)) updateSelectInput(session, inputId = "gline2_size", choices = names(fdata), selected = names(fdata)) } else if (dim(f_data)[2] == 0) { updateSelectInput(session, 'gline2_group', choices = '', selected = '') updateSelectInput(session, 'gline2_col', choices = '', selected = '') updateSelectInput(session, 'gline2_ltype', choices = '', selected = '') updateSelectInput(session, 'gline2_size', choices = '', selected = '') } else { updateSelectInput(session, 'gline2_group', choices = names(f_data), selected = names(f_data)) updateSelectInput(session, 'gline2_col', choices = names(f_data), selected = names(f_data)) updateSelectInput(session, 'gline2_ltype', choices = names(f_data), selected = names(f_data)) updateSelectInput(session, 'gline2_size', choices = names(f_data), selected = names(f_data)) } }) gline2_col_map <- eventReactive(input$gline2_col_yes, { selectInput('gline2_col', '', choices = "", selected = "") }) observeEvent(input$gline2_col_yes, { f_data <- final_split$train[, sapply(final_split$train, is.factor)] if (is.null(dim(f_data))) { h <- final_split$train %>% map(is.factor) %>% unlist() q <- names(which(h == TRUE)) fdata <- tibble::as_data_frame(f_data) colnames(fdata) <- q updateSelectInput(session, inputId = "gline2_col", choices = names(fdata), selected = '') } else if (dim(f_data)[2] == 0) { updateSelectInput(session, 'gline2_col', choices = '', selected = '') } else { updateSelectInput(session, 'gline2_col', choices = names(f_data), selected = '') } }) output$gline2_col_ui <- renderUI({ gline2_col_map() }) gline2_ltype_map <- eventReactive(input$gline2_ltype_yes, { selectInput('gline2_ltype', '', choices = "", selected = "") }) observeEvent(input$gline2_ltype_yes, { f_data <- final_split$train[, sapply(final_split$train, is.factor)] if (is.null(dim(f_data))) { h <- final_split$train %>% map(is.factor) %>% unlist() q <- names(which(h == TRUE)) fdata <- tibble::as_data_frame(f_data) colnames(fdata) <- q updateSelectInput(session, inputId = "gline2_ltype", choices = names(fdata), selected = '') } else if (dim(f_data)[2] == 0) { updateSelectInput(session, 'gline2_ltype', choices = '', selected = '') } else { updateSelectInput(session, 'gline2_ltype', choices = names(f_data), selected = '') } }) output$gline2_ltype_ui <- renderUI({ gline2_ltype_map() }) gline2_size_map <- eventReactive(input$gline2_size_yes, { selectInput('gline2_size', '', choices = "", selected = "") }) observeEvent(input$gline2_size_yes, { f_data <- final_split$train[, sapply(final_split$train, is.factor)] if (is.null(dim(f_data))) { h <- final_split$train %>% map(is.factor) %>% unlist() q <- names(which(h == TRUE)) fdata <- tibble::as_data_frame(f_data) colnames(fdata) <- q updateSelectInput(session, inputId = "gline2_size", choices = names(fdata), selected = '') } else if (dim(f_data)[2] == 0) { updateSelectInput(session, 'gline2_size', choices = '', selected = '') } else { updateSelectInput(session, 'gline2_size', choices = names(f_data), selected = '') } }) output$gline2_size_ui <- renderUI({ gline2_size_map() }) gselectedline2 <- reactive({ req(input$gline2_select_x) out <- final_split$train %>% select(input$gline2_y) out }) yline2min <- reactive({ out <- gselectedline2() %>% select(1) %>% unlist() %>% min result <- out - ceiling(out * 0.1) result }) ylinemax2 <- reactive({ out <- gselectedline2() %>% select(1) %>% unlist() %>% max out }) output$ui_gline2yrange_min <- renderUI({ df <- final_split$train if (is.null(df)) return(NULL) numericInput('gline2y_range_min', 'Y Axis Min', value = yline2min()) }) output$ui_gline2yrange_max <- renderUI({ df <- final_split$train if (is.null(df)) return(NULL) numericInput('gline2y_range_max', 'Y Axis Max', value = ylinemax2()) }) output$gline2_plot_1 <- renderPlot({ ggline2(data = final_split$train, x = input$gline2_select_x, columns = input$gline2_y, groups = input$gline2_group, title = input$gline2_title, sub = input$gline2_subtitle, xlab = input$gline2_xlabel, ylab = input$gline2_ylabel) }) output$gline2_plot_2 <- renderPlot({ ggline2(data = final_split$train, x = input$gline2_select_x, columns = input$gline2_y, groups = input$gline2_group, cols = input$gline2_col, ltypes = input$gline2_ltype, sizes = input$gline2_size, title = input$gline2_title, sub = input$gline2_subtitle, xlab = input$gline2_xlabel, ylab = input$gline2_ylabel) }) output$gline2_plot_3 <- renderPlot({ ggline2(data = final_split$train, x = input$gline2_select_x, columns = input$gline2_y, groups = input$gline2_group, cols = input$gline2_col, ltypes = input$gline2_ltype, sizes = input$gline2_size, title = input$gline2_title, sub = input$gline2_subtitle, xlab = input$gline2_xlabel, ylab = input$gline2_ylabel, yaxlimit = TRUE, y1 = input$gline2y_range_min, y2 = input$gline2y_range_max, remove_xax = input$gline2_remx, remove_yax = input$gline2_remy) }) output$gline2_plot_4 <- renderPlot({ ggline2(data = final_split$train, x = input$gline2_select_x, columns = input$gline2_y, groups = input$gline2_group, cols = input$gline2_col, ltypes = input$gline2_ltype, sizes = input$gline2_size, title = input$gline2_title, sub = input$gline2_subtitle, xlab = input$gline2_xlabel, ylab = input$gline2_ylabel, yaxlimit = TRUE, y1 = input$gline2y_range_min, y2 = input$gline2y_range_max, remove_xax = input$gline2_remx, remove_yax = input$gline2_remy, add_text = input$gline2_text, xloc = input$gline2_text_x_loc, yloc = input$gline2_text_y_loc, label = input$gline2_plottext, tex_color = input$gline2_textcolor, tex_size = input$gline2_textsize) }) output$gline2_plot_5 <- renderPlot({ ggline2(data = final_split$train, x = input$gline2_select_x, columns = input$gline2_y, groups = input$gline2_group, cols = input$gline2_col, ltypes = input$gline2_ltype, sizes = input$gline2_size, title = input$gline2_title, sub = input$gline2_subtitle, xlab = input$gline2_xlabel, ylab = input$gline2_ylabel, yaxlimit = TRUE, y1 = input$gline2y_range_min, y2 = input$gline2y_range_max, remove_xax = input$gline2_remx, remove_yax = input$gline2_remy, add_text = input$gline2_text, xloc = input$gline2_text_x_loc, yloc = input$gline2_text_y_loc, label = input$gline2_plottext, tex_color = input$gline2_textcolor, tex_size = input$gline2_textsize, title_col = input$gline22_title_col, title_fam = input$gline2_title_fam, title_face = input$gline2_title_font, title_size = input$gline2_title_size, title_hjust = input$gline2_title_hjust, title_vjust = input$gline2_title_vjust, sub_col = input$gline2_sub_col, sub_fam = input$gline2_sub_fam, sub_face = input$gline2_subtitle_font, sub_size = input$gline2_sub_size, sub_hjust = input$gline2_sub_hjust, sub_vjust = input$gline2_sub_vjust, xax_col = input$gline2_xlab_col, xax_fam = input$gline2_xlab_fam, xax_face = input$gline2_xlab_font, xax_size = input$gline2_xlab_size, xax_hjust = input$gline2_xlab_hjust, xax_vjust = input$gline2_xlab_vjust, yax_col = input$gline2_ylab_col, yax_fam = input$gline2_ylab_fam, yax_face = input$gline2_ylab_font, yax_size = input$gline2_ylab_size, yax_hjust = input$gline2_ylab_hjust, yax_vjust = input$gline2_ylab_vjust) }) output$gline2_plot_6 <- renderPlot({ ggline2(data = final_split$train, x = input$gline2_select_x, columns = input$gline2_y, groups = input$gline2_group, cols = input$gline2_col, ltypes = input$gline2_ltype, sizes = input$gline2_size, title = input$gline2_title, sub = input$gline2_subtitle, xlab = input$gline2_xlabel, ylab = input$gline2_ylabel, yaxlimit = TRUE, y1 = input$gline2y_range_min, y2 = input$gline2y_range_max, remove_xax = input$gline2_remx, remove_yax = input$gline2_remy, add_text = input$gline2_text, xloc = input$gline2_text_x_loc, yloc = input$gline2_text_y_loc, label = input$gline2_plottext, tex_color = input$gline2_textcolor, tex_size = input$gline2_textsize, title_col = input$gline22_title_col, title_fam = input$gline2_title_fam, title_face = input$gline2_title_font, title_size = input$gline2_title_size, title_hjust = input$gline2_title_hjust, title_vjust = input$gline2_title_vjust, sub_col = input$gline2_sub_col, sub_fam = input$gline2_sub_fam, sub_face = input$gline2_subtitle_font, sub_size = input$gline2_sub_size, sub_hjust = input$gline2_sub_hjust, sub_vjust = input$gline2_sub_vjust, xax_col = input$gline2_xlab_col, xax_fam = input$gline2_xlab_fam, xax_face = input$gline2_xlab_font, xax_size = input$gline2_xlab_size, xax_hjust = input$gline2_xlab_hjust, xax_vjust = input$gline2_xlab_vjust, yax_col = input$gline2_ylab_col, yax_fam = input$gline2_ylab_fam, yax_face = input$gline2_ylab_font, yax_size = input$gline2_ylab_size, yax_hjust = input$gline2_ylab_hjust, yax_vjust = input$gline2_ylab_vjust, theme = input$gline2_theme) }) output$gline2_plot_7 <- renderPlot({ ggline2(data = final_split$train, x = input$gline2_select_x, columns = input$gline2_y, groups = input$gline2_group, cols = input$gline2_col, ltypes = input$gline2_ltype, sizes = input$gline2_size, title = input$gline2_title, sub = input$gline2_subtitle, xlab = input$gline2_xlabel, ylab = input$gline2_ylabel, yaxlimit = TRUE, y1 = input$gline2y_range_min, y2 = input$gline2y_range_max, remove_xax = input$gline2_remx, remove_yax = input$gline2_remy, add_text = input$gline2_text, xloc = input$gline2_text_x_loc, yloc = input$gline2_text_y_loc, label = input$gline2_plottext, tex_color = input$gline2_textcolor, tex_size = input$gline2_textsize, title_col = input$gline22_title_col, title_fam = input$gline2_title_fam, title_face = input$gline2_title_font, title_size = input$gline2_title_size, title_hjust = input$gline2_title_hjust, title_vjust = input$gline2_title_vjust, sub_col = input$gline2_sub_col, sub_fam = input$gline2_sub_fam, sub_face = input$gline2_subtitle_font, sub_size = input$gline2_sub_size, sub_hjust = input$gline2_sub_hjust, sub_vjust = input$gline2_sub_vjust, xax_col = input$gline2_xlab_col, xax_fam = input$gline2_xlab_fam, xax_face = input$gline2_xlab_font, xax_size = input$gline2_xlab_size, xax_hjust = input$gline2_xlab_hjust, xax_vjust = input$gline2_xlab_vjust, yax_col = input$gline2_ylab_col, yax_fam = input$gline2_ylab_fam, yax_face = input$gline2_ylab_font, yax_size = input$gline2_ylab_size, yax_hjust = input$gline2_ylab_hjust, yax_vjust = input$gline2_ylab_vjust, theme = input$gline2_theme) })
/scratch/gouwar.j/cran-all/cranData/xplorerr/inst/app-visualize/logic/logic_gline2.R
source('helper/ggpie.R') observeEvent(input$finalok, { f_data <- final_split$train[, sapply(final_split$train, is.factor)] # validate(need(!dim(f_data)[2] == 0, 'No factor variables in the data.')) if (is.null(dim(f_data))) { k <- final_split$train %>% map(is.factor) %>% unlist() j <- names(which(k == TRUE)) fdata <- tibble::as_data_frame(f_data) colnames(fdata) <- j updateSelectInput(session, 'gpie_select_x', choices = names(fdata), selected = names(fdata)) } else if (dim(f_data)[2] == 0) { updateSelectInput(session, 'gpie_select_x', choices = '', selected = '') } else { updateSelectInput(session, 'gpie_select_x', choices = names(f_data)) } }) observeEvent(input$submit_part_train_per, { f_data <- final_split$train[, sapply(final_split$train, is.factor)] # validate(need(!dim(f_data)[2] == 0, 'No factor variables in the data.')) if (is.null(dim(f_data))) { k <- final_split$train %>% map(is.factor) %>% unlist() j <- names(which(k == TRUE)) fdata <- tibble::as_data_frame(f_data) colnames(fdata) <- j updateSelectInput(session, 'gpie_select_x', choices = names(fdata), selected = names(fdata)) } else if (dim(f_data)[2] == 0) { updateSelectInput(session, 'gpie_select_x', choices = '', selected = '') } else { updateSelectInput(session, 'gpie_select_x', choices = names(f_data)) } }) output$gpie_plot_1 <- renderPlot({ ggpie(data = final_split$train, x = input$gpie_select_x, title = input$gpie_title, xlab = input$gpie_xlabel, ylab = input$gpie_ylabel) })
/scratch/gouwar.j/cran-all/cranData/xplorerr/inst/app-visualize/logic/logic_gpie.R
source('helper/ggscatter.R') observeEvent(input$finalok, { num_data <- final_split$train[, sapply(final_split$train, is.numeric)] if (is.null(dim(num_data))) { k <- final_split$train %>% map(is.numeric) %>% unlist() j <- names(which(k == TRUE)) numdata <- tibble::as_data_frame(num_data) colnames(numdata) <- j updateSelectInput(session, 'gscatter_select_x', choices = names(numdata), selected = names(numdata)) updateSelectInput(session, 'gscatter_select_y', choices = names(numdata), selected = names(numdata)) } else if (ncol(num_data) < 1) { updateSelectInput(session, 'gscatter_select_x', choices = '', selected = '') updateSelectInput(session, 'gscatter_select_y', choices = '', selected = '') } else { updateSelectInput(session, 'gscatter_select_x', choices = names(num_data)) updateSelectInput(session, 'gscatter_select_y', choices = names(num_data)) } f_data <- final_split$train[, sapply(final_split$train, is.factor)] # validate(need(!dim(f_data)[2] == 0, 'No factor variables in the data.')) if (is.null(dim(f_data))) { k <- final_split$train %>% map(is.factor) %>% unlist() j <- names(which(k == TRUE)) fdata <- tibble::as_data_frame(f_data) colnames(fdata) <- j updateSelectInput(session, inputId = "gaes_color", choices = names(fdata)) updateSelectInput(session, inputId = "gaes_shape", choices = names(fdata)) updateSelectInput(session, inputId = "gaes_size", choices = names(fdata)) } else if (dim(f_data)[2] == 0) { updateSelectInput(session, 'gaes_color', choices = '', selected = '') updateSelectInput(session, 'gaes_shape', choices = '', selected = '') updateSelectInput(session, 'gaes_size', choices = '', selected = '') } else { updateSelectInput(session, 'gaes_color', choices = names(f_data)) updateSelectInput(session, 'gaes_shape', choices = names(f_data)) updateSelectInput(session, 'gaes_size', choices = names(f_data)) } }) observeEvent(input$submit_part_train_per, { num_data <- final_split$train[, sapply(final_split$train, is.numeric)] if (is.null(dim(num_data))) { k <- final_split$train %>% map(is.numeric) %>% unlist() j <- names(which(k == TRUE)) numdata <- tibble::as_data_frame(num_data) colnames(numdata) <- j updateSelectInput(session, 'gscatter_select_x', choices = names(numdata), selected = names(numdata)) updateSelectInput(session, 'gscatter_select_y', choices = names(numdata), selected = names(numdata)) } else if (ncol(num_data) < 1) { updateSelectInput(session, 'gscatter_select_x', choices = '', selected = '') updateSelectInput(session, 'gscatter_select_y', choices = '', selected = '') } else { updateSelectInput(session, 'gscatter_select_x', choices = names(num_data)) updateSelectInput(session, 'gscatter_select_y', choices = names(num_data)) } f_data <- final_split$train[, sapply(final_split$train, is.factor)] # validate(need(!dim(f_data)[2] == 0, 'No factor variables in the data.')) if (is.null(dim(f_data))) { k <- final_split$train %>% map(is.factor) %>% unlist() j <- names(which(k == TRUE)) fdata <- tibble::as_data_frame(f_data) colnames(fdata) <- j updateSelectInput(session, inputId = "gaes_color", choices = names(fdata)) updateSelectInput(session, inputId = "gaes_shape", choices = names(fdata)) updateSelectInput(session, inputId = "gaes_size", choices = names(fdata)) } else if (dim(f_data)[2] == 0) { updateSelectInput(session, 'gaes_color', choices = '', selected = '') updateSelectInput(session, 'gaes_shape', choices = '', selected = '') updateSelectInput(session, 'gaes_size', choices = '', selected = '') } else { updateSelectInput(session, 'gaes_color', choices = names(f_data)) updateSelectInput(session, 'gaes_shape', choices = names(f_data)) updateSelectInput(session, 'gaes_size', choices = names(f_data)) } }) # selected data gselectedscat <- reactive({ req(input$gscatter_select_x) out <- final_split$train[, c(input$gscatter_select_x, input$gscatter_select_y, input$gaes_color, input$gaes_shape, input$gaes_size)] }) output$ui_gxrange_min <- renderUI({ df <- final_split$train if (is.null(df)) return(NULL) numericInput('gx_range_min', 'X Axis Min', value = min(as.numeric(gselectedscat()[[1]]))) }) output$ui_gxrange_max <- renderUI({ df <- final_split$train if (is.null(df)) return(NULL) numericInput('gx_range_max', 'X Axis Max', value = max(as.numeric(gselectedscat()[[1]]))) }) output$ui_gyrange_min <- renderUI({ df <- final_split$train if (is.null(df)) return(NULL) numericInput('gy_range_min', 'Y Axis Min', value = min(as.numeric(gselectedscat()[[2]]))) }) output$ui_gyrange_max <- renderUI({ df <- final_split$train if (is.null(df)) return(NULL) numericInput('gy_range_max', 'Y Axis Max', value = max(as.numeric(gselectedscat()[[2]]))) }) # gselected_y <- reactive({ # req(input$scatter_select_y) # out <- final_split$train[, input$scatter_select_y] # }) output$gscatter_plot_1 <- renderPlot({ gscatter(data = gselectedscat(), x = input$gscatter_select_x, y = input$gscatter_select_y, title = input$gscatter_title, sub = input$gscatter_subtitle, xlab = input$gscatter_xlabel, ylab = input$gscatter_ylabel) }) output$gscatter_plot_2 <- renderPlot({ if (input$geas == 'Use Variables') { gscatter(data = gselectedscat(), x = input$gscatter_select_x, y = input$gscatter_select_y, aes_var = TRUE, title = input$gscatter_title, sub = input$gscatter_subtitle, xlab = input$gscatter_xlabel, ylab = input$gscatter_ylabel, color = input$gaes_color, shape = input$gaes_shape, size = input$gaes_size) } else { gscatter(data = gselectedscat(), x = input$gscatter_select_x, y = input$gscatter_select_y, aes_var = FALSE, title = input$gscatter_title, sub = input$gscatter_subtitle, xlab = input$gscatter_xlabel, ylab = input$gscatter_ylabel, color = input$gscat_color, shape = input$gscat_shape, size = input$gscat_size, fill = input$gscat_fill) } }) output$gscatter_plot_3 <- renderPlot({ if (input$geas == 'Use Variables') { gscatter(data = gselectedscat(), x = input$gscatter_select_x, y = input$gscatter_select_y, aes_var = TRUE, title = input$gscatter_title, sub = input$gscatter_subtitle, xlab = input$gscatter_xlabel, ylab = input$gscatter_ylabel, color = input$gaes_color, shape = input$gaes_shape, size = input$gaes_size, xaxlimit = TRUE, yaxlimit = TRUE, x1 = input$gx_range_min, x2 = input$gx_range_max, y1 = input$gy_range_min, y2 = input$gy_range_max) } else { gscatter(data = gselectedscat(), x = input$gscatter_select_x, y = input$gscatter_select_y, aes_var = FALSE, title = input$gscatter_title, sub = input$gscatter_subtitle, xlab = input$gscatter_xlabel, ylab = input$gscatter_ylabel, color = input$gscat_color, shape = input$gscat_shape, size = input$gscat_size, fill = input$gscat_fill, xaxlimit = TRUE, yaxlimit = TRUE, x1 = input$gx_range_min, x2 = input$gx_range_max, y1 = input$gy_range_min, y2 = input$gy_range_max) } }) output$gscatter_plot_4 <- renderPlot({ if (input$geas == 'Use Variables') { gscatter(data = gselectedscat(), x = input$gscatter_select_x, y = input$gscatter_select_y, aes_var = TRUE, title = input$gscatter_title, sub = input$gscatter_subtitle, xlab = input$gscatter_xlabel, ylab = input$gscatter_ylabel, color = input$gaes_color, shape = input$gaes_shape, size = input$gaes_size, xaxlimit = TRUE, yaxlimit = TRUE, x1 = input$gx_range_min, x2 = input$gx_range_max, y1 = input$gy_range_min, y2 = input$gy_range_max, reg_line = input$gscat_line, reg_method = as.character(input$greg_type), reg_se = input$greg_se) } else { gscatter(data = gselectedscat(), x = input$gscatter_select_x, y = input$gscatter_select_y, aes_var = FALSE, title = input$gscatter_title, sub = input$gscatter_subtitle, xlab = input$gscatter_xlabel, ylab = input$gscatter_ylabel, color = input$gscat_color, shape = input$gscat_shape, size = input$gscat_size, fill = input$gscat_fill, xaxlimit = TRUE, yaxlimit = TRUE, x1 = input$gx_range_min, x2 = input$gx_range_max, y1 = input$gy_range_min, y2 = input$gy_range_max, reg_line = input$gscat_line, reg_method = as.character(input$greg_type), reg_se = input$greg_se) } }) output$gscatter_plot_5 <- renderPlot({ if (input$geas == 'Use Variables') { gscatter(data = gselectedscat(), x = input$gscatter_select_x, y = input$gscatter_select_y, aes_var = TRUE, title = input$gscatter_title, sub = input$gscatter_subtitle, xlab = input$gscatter_xlabel, ylab = input$gscatter_ylabel, color = input$gaes_color, shape = input$gaes_shape, size = input$gaes_size, xaxlimit = TRUE, yaxlimit = TRUE, x1 = input$gx_range_min, x2 = input$gx_range_max, y1 = input$gy_range_min, y2 = input$gy_range_max, reg_line = input$gscat_line, reg_method = as.character(input$greg_type), reg_se = input$greg_se, add_text = input$gscat_text, xloc = input$gscatter_text_x_loc, yloc = input$gscatter_text_y_loc, label = input$gscatter_plottext, tex_color = input$gscatter_textcolor, tex_size = input$gscatter_textsize) } else { gscatter(data = gselectedscat(), x = input$gscatter_select_x, y = input$gscatter_select_y, aes_var = FALSE, title = input$gscatter_title, sub = input$gscatter_subtitle, xlab = input$gscatter_xlabel, ylab = input$gscatter_ylabel, color = input$gscat_color, shape = input$gscat_shape, size = input$gscat_size, fill = input$gscat_fill, xaxlimit = TRUE, yaxlimit = TRUE, x1 = input$gx_range_min, x2 = input$gx_range_max, y1 = input$gy_range_min, y2 = input$gy_range_max, reg_line = input$gscat_line, reg_method = as.character(input$greg_type), reg_se = input$greg_se, add_text = input$gscat_text, xloc = input$gscatter_text_x_loc, yloc = input$gscatter_text_y_loc, label = input$gscatter_plottext, tex_color = input$gscatter_textcolor, tex_size = input$gscatter_textsize) } }) output$gscatter_plot_6 <- renderPlot({ if (input$geas == 'Use Variables') { gscatter(data = gselectedscat(), x = input$gscatter_select_x, y = input$gscatter_select_y, aes_var = TRUE, title = input$gscatter_title, sub = input$gscatter_subtitle, xlab = input$gscatter_xlabel, ylab = input$gscatter_ylabel, color = input$gaes_color, shape = input$gaes_shape, size = input$gaes_size, xaxlimit = TRUE, yaxlimit = TRUE, x1 = input$gx_range_min, x2 = input$gx_range_max, y1 = input$gy_range_min, y2 = input$gy_range_max, reg_line = input$gscat_line, reg_method = as.character(input$greg_type), reg_se = input$greg_se, add_text = input$gscat_text, xloc = input$gscatter_text_x_loc, yloc = input$gscatter_text_y_loc, label = input$gscatter_plottext, tex_color = input$gscatter_textcolor, tex_size = input$gscatter_textsize, title_col = input$gscat_title_col, title_fam = input$gscat_title_fam, title_face = input$gscat_title_font, title_size = input$gscat_title_size, title_hjust = input$gscat_title_hjust, title_vjust = input$gscat_title_vjust, sub_col = input$gscat_sub_col, sub_fam = input$gscat_sub_fam, sub_face = input$gscat_subtitle_font, sub_size = input$gscat_sub_size, sub_hjust = input$gscat_sub_hjust, sub_vjust = input$gscat_sub_vjust, xax_col = input$gscat_xlab_col, xax_fam = input$gscat_xlab_fam, xax_face = input$gscat_xlab_font, xax_size = input$gscat_xlab_size, xax_hjust = input$gscat_xlab_hjust, xax_vjust = input$gscat_xlab_vjust, yax_col = input$gscat_ylab_col, yax_fam = input$gscat_ylab_fam, yax_face = input$gscat_ylab_font, yax_size = input$gscat_ylab_size, yax_hjust = input$gscat_ylab_hjust, yax_vjust = input$gscat_ylab_vjust) } else { gscatter(data = gselectedscat(), x = input$gscatter_select_x, y = input$gscatter_select_y, aes_var = FALSE, title = input$gscatter_title, sub = input$gscatter_subtitle, xlab = input$gscatter_xlabel, ylab = input$gscatter_ylabel, color = input$gscat_color, shape = input$gscat_shape, size = input$gscat_size, fill = input$gscat_fill, xaxlimit = TRUE, yaxlimit = TRUE, x1 = input$gx_range_min, x2 = input$gx_range_max, y1 = input$gy_range_min, y2 = input$gy_range_max, reg_line = input$gscat_line, reg_method = as.character(input$greg_type), reg_se = input$greg_se, add_text = input$gscat_text, xloc = input$gscatter_text_x_loc, yloc = input$gscatter_text_y_loc, label = input$gscatter_plottext, tex_color = input$gscatter_textcolor, tex_size = input$gscatter_textsize, title_col = input$gscat_title_col, title_fam = input$gscat_title_fam, title_face = input$gscat_title_font, title_size = input$gscat_title_size, title_hjust = input$gscat_title_hjust, title_vjust = input$gscat_title_vjust, sub_col = input$gscat_sub_col, sub_fam = input$gscat_sub_fam, sub_face = input$gscat_subtitle_font, sub_size = input$gscat_sub_size, sub_hjust = input$gscat_sub_hjust, sub_vjust = input$gscat_sub_vjust, xax_col = input$gscat_xlab_col, xax_fam = input$gscat_xlab_fam, xax_face = input$gscat_xlab_font, xax_size = input$gscat_xlab_size, xax_hjust = input$gscat_xlab_hjust, xax_vjust = input$gscat_xlab_vjust, yax_col = input$gscat_ylab_col, yax_fam = input$gscat_ylab_fam, yax_face = input$gscat_ylab_font, yax_size = input$gscat_ylab_size, yax_hjust = input$gscat_ylab_hjust, yax_vjust = input$gscat_ylab_vjust) } }) output$gscatter_plot_7 <- renderPlot({ if (input$geas == 'Use Variables') { gscatter(data = gselectedscat(), x = input$gscatter_select_x, y = input$gscatter_select_y, aes_var = TRUE, title = input$gscatter_title, sub = input$gscatter_subtitle, xlab = input$gscatter_xlabel, ylab = input$gscatter_ylabel, color = input$gaes_color, shape = input$gaes_shape, size = input$gaes_size, xaxlimit = TRUE, yaxlimit = TRUE, x1 = input$gx_range_min, x2 = input$gx_range_max, y1 = input$gy_range_min, y2 = input$gy_range_max, reg_line = input$gscat_line, reg_method = as.character(input$greg_type), reg_se = input$greg_se, add_text = input$gscat_text, xloc = input$gscatter_text_x_loc, yloc = input$gscatter_text_y_loc, label = input$gscatter_plottext, tex_color = input$gscatter_textcolor, tex_size = input$gscatter_textsize, title_col = input$gscat_title_col, title_fam = input$gscat_title_fam, title_face = input$gscat_title_font, title_size = input$gscat_title_size, title_hjust = input$gscat_title_hjust, title_vjust = input$gscat_title_vjust, sub_col = input$gscat_sub_col, sub_fam = input$gscat_sub_fam, sub_face = input$gscat_subtitle_font, sub_size = input$gscat_sub_size, sub_hjust = input$gscat_sub_hjust, sub_vjust = input$gscat_sub_vjust, xax_col = input$gscat_xlab_col, xax_fam = input$gscat_xlab_fam, xax_face = input$gscat_xlab_font, xax_size = input$gscat_xlab_size, xax_hjust = input$gscat_xlab_hjust, xax_vjust = input$gscat_xlab_vjust, yax_col = input$gscat_ylab_col, yax_fam = input$gscat_ylab_fam, yax_face = input$gscat_ylab_font, yax_size = input$gscat_ylab_size, yax_hjust = input$gscat_ylab_hjust, yax_vjust = input$gscat_ylab_vjust, theme = input$gscatter_theme) } else { gscatter(data = gselectedscat(), x = input$gscatter_select_x, y = input$gscatter_select_y, aes_var = FALSE, title = input$gscatter_title, sub = input$gscatter_subtitle, xlab = input$gscatter_xlabel, ylab = input$gscatter_ylabel, color = input$gscat_color, shape = input$gscat_shape, size = input$gscat_size, fill = input$gscat_fill, xaxlimit = TRUE, yaxlimit = TRUE, x1 = input$gx_range_min, x2 = input$gx_range_max, y1 = input$gy_range_min, y2 = input$gy_range_max, reg_line = input$gscat_line, reg_method = as.character(input$greg_type), reg_se = input$greg_se, add_text = input$gscat_text, xloc = input$gscatter_text_x_loc, yloc = input$gscatter_text_y_loc, label = input$gscatter_plottext, tex_color = input$gscatter_textcolor, tex_size = input$gscatter_textsize, title_col = input$gscat_title_col, title_fam = input$gscat_title_fam, title_face = input$gscat_title_font, title_size = input$gscat_title_size, title_hjust = input$gscat_title_hjust, title_vjust = input$gscat_title_vjust, sub_col = input$gscat_sub_col, sub_fam = input$gscat_sub_fam, sub_face = input$gscat_subtitle_font, sub_size = input$gscat_sub_size, sub_hjust = input$gscat_sub_hjust, sub_vjust = input$gscat_sub_vjust, xax_col = input$gscat_xlab_col, xax_fam = input$gscat_xlab_fam, xax_face = input$gscat_xlab_font, xax_size = input$gscat_xlab_size, xax_hjust = input$gscat_xlab_hjust, xax_vjust = input$gscat_xlab_vjust, yax_col = input$gscat_ylab_col, yax_fam = input$gscat_ylab_fam, yax_face = input$gscat_ylab_font, yax_size = input$gscat_ylab_size, yax_hjust = input$gscat_ylab_hjust, yax_vjust = input$gscat_ylab_vjust, theme = input$gscatter_theme) } }) output$gscatter_plot_8 <- renderPlot({ if (input$geas == 'Use Variables') { gscatter(data = gselectedscat(), x = input$gscatter_select_x, y = input$gscatter_select_y, aes_var = TRUE, title = input$gscatter_title, sub = input$gscatter_subtitle, xlab = input$gscatter_xlabel, ylab = input$gscatter_ylabel, color = input$gaes_color, shape = input$gaes_shape, size = input$gaes_size, xaxlimit = TRUE, yaxlimit = TRUE, x1 = input$gx_range_min, x2 = input$gx_range_max, y1 = input$gy_range_min, y2 = input$gy_range_max, reg_line = input$gscat_line, reg_method = as.character(input$greg_type), reg_se = input$greg_se, add_text = input$gscat_text, xloc = input$gscatter_text_x_loc, yloc = input$gscatter_text_y_loc, label = input$gscatter_plottext, tex_color = input$gscatter_textcolor, tex_size = input$gscatter_textsize, title_col = input$gscat_title_col, title_fam = input$gscat_title_fam, title_face = input$gscat_title_font, title_size = input$gscat_title_size, title_hjust = input$gscat_title_hjust, title_vjust = input$gscat_title_vjust, sub_col = input$gscat_sub_col, sub_fam = input$gscat_sub_fam, sub_face = input$gscat_subtitle_font, sub_size = input$gscat_sub_size, sub_hjust = input$gscat_sub_hjust, sub_vjust = input$gscat_sub_vjust, xax_col = input$gscat_xlab_col, xax_fam = input$gscat_xlab_fam, xax_face = input$gscat_xlab_font, xax_size = input$gscat_xlab_size, xax_hjust = input$gscat_xlab_hjust, xax_vjust = input$gscat_xlab_vjust, yax_col = input$gscat_ylab_col, yax_fam = input$gscat_ylab_fam, yax_face = input$gscat_ylab_font, yax_size = input$gscat_ylab_size, yax_hjust = input$gscat_ylab_hjust, yax_vjust = input$gscat_ylab_vjust, theme = input$gscatter_theme) } else { gscatter(data = gselectedscat(), x = input$gscatter_select_x, y = input$gscatter_select_y, aes_var = FALSE, title = input$gscatter_title, sub = input$gscatter_subtitle, xlab = input$gscatter_xlabel, ylab = input$gscatter_ylabel, color = input$gscat_color, shape = input$gscat_shape, size = input$gscat_size, fill = input$gscat_fill, xaxlimit = TRUE, yaxlimit = TRUE, x1 = input$gx_range_min, x2 = input$gx_range_max, y1 = input$gy_range_min, y2 = input$gy_range_max, reg_line = input$gscat_line, reg_method = as.character(input$greg_type), reg_se = input$greg_se, add_text = input$gscat_text, xloc = input$gscatter_text_x_loc, yloc = input$gscatter_text_y_loc, label = input$gscatter_plottext, tex_color = input$gscatter_textcolor, tex_size = input$gscatter_textsize, title_col = input$gscat_title_col, title_fam = input$gscat_title_fam, title_face = input$gscat_title_font, title_size = input$gscat_title_size, title_hjust = input$gscat_title_hjust, title_vjust = input$gscat_title_vjust, sub_col = input$gscat_sub_col, sub_fam = input$gscat_sub_fam, sub_face = input$gscat_subtitle_font, sub_size = input$gscat_sub_size, sub_hjust = input$gscat_sub_hjust, sub_vjust = input$gscat_sub_vjust, xax_col = input$gscat_xlab_col, xax_fam = input$gscat_xlab_fam, xax_face = input$gscat_xlab_font, xax_size = input$gscat_xlab_size, xax_hjust = input$gscat_xlab_hjust, xax_vjust = input$gscat_xlab_vjust, yax_col = input$gscat_ylab_col, yax_fam = input$gscat_ylab_fam, yax_face = input$gscat_ylab_font, yax_size = input$gscat_ylab_size, yax_hjust = input$gscat_ylab_hjust, yax_vjust = input$gscat_ylab_vjust, theme = input$gscatter_theme) } })
/scratch/gouwar.j/cran-all/cranData/xplorerr/inst/app-visualize/logic/logic_gscatter.R
library(shiny) source("helper/histogram.R") source("helper/freq-cont.R") # update variable selection for bar plots # observe({ # updateSelectInput(session, 'hist_select', choices = names(data())) # }) observeEvent(input$finalok, { num_data <- final_split$train[, sapply(final_split$train, is.numeric)] if (is.null(dim(num_data))) { k <- final_split$train %>% map(is.numeric) %>% unlist() j <- names(which(k == TRUE)) numdata <- tibble::as_data_frame(num_data) colnames(numdata) <- j updateSelectInput(session, 'hist_select', choices = names(numdata), selected = names(numdata)) } else if (ncol(num_data) < 1) { updateSelectInput(session, 'hist_select', choices = '', selected = '') } else { updateSelectInput(session, 'hist_select', choices = names(num_data)) } }) observeEvent(input$submit_part_train_per, { num_data <- final_split$train[, sapply(final_split$train, is.numeric)] if (is.null(dim(num_data))) { k <- final_split$train %>% map(is.numeric) %>% unlist() j <- names(which(k == TRUE)) numdata <- tibble::as_data_frame(num_data) colnames(numdata) <- j updateSelectInput(session, 'hist_select', choices = names(numdata), selected = names(numdata)) } else if (ncol(num_data) < 1) { updateSelectInput(session, 'hist_select', choices = '', selected = '') } else { updateSelectInput(session, 'hist_select', choices = names(num_data)) } }) # selected data hist_data <- reactive({ req(input$hist_select) box_data <- final_split$train[, input$hist_select] box_data <- as.data.frame(box_data) names(box_data) <- as.character(input$hist_select) box_data }) # dynamic UI for histogram colors output$ui_ncolhist <- renderUI({ ncol <- as.integer(input$ncolhist) if (ncol < 1) { NULL } else { lapply(1:ncol, function(i) { textInput(paste("n_col_hist", i), label = paste0("Color ", i), value = 'blue') }) } }) colours_hist <- reactive({ ncol <- as.integer(input$ncolhist) if (ncol < 1) { colors <- NULL } else { collect <- list(lapply(1:ncol, function(i) { input[[paste("n_col_hist", i)]] })) colors <- unlist(collect) } colors }) # dynamic UI for histogram border colors output$ui_nborhist <- renderUI({ ncol <- as.integer(input$nborhist) if (ncol < 1) { NULL } else { lapply(1:ncol, function(i) { textInput(paste("n_bor_hist", i), label = paste0("Border Color ", i), value = 'black') }) } }) borders_hist <- reactive({ ncol <- as.integer(input$nborhist) if (ncol < 1) { colors <- NULL } else { collect <- list(lapply(1:ncol, function(i) { input[[paste("n_bor_hist", i)]] })) colors <- unlist(collect) } colors }) # # dynamic UI for shading density # output$ui_nhistdensity <- renderUI({ # ncol <- as.integer(input$nhistdensity) # lapply(1:ncol, function(i) { # numericInput(paste("n_histdensity_", i), # label = paste0("Density ", i), # value = 1, min = 1) # }) # }) # density_hist <- reactive({ # ncol <- as.integer(input$nhistdensity) # collect <- list(lapply(1:ncol, function(i) { # input[[paste("n_histdensity_", i)]] # })) # colors <- unlist(collect) # }) # # dynamic UI for shading angle # output$ui_nhistangle <- renderUI({ # ncol <- as.integer(input$nhistangle) # lapply(1:ncol, function(i) { # numericInput(paste("n_histangle_", i), # label = paste0("Density Angle ", i), # value = 1, min = 1) # }) # }) # angle_hist <- reactive({ # ncol <- as.integer(input$nhistangle) # collect <- list(lapply(1:ncol, function(i) { # input[[paste("n_histangle_", i)]] # })) # colors <- unlist(collect) # }) # dynamic UI for histogram binning intervals output$ui_nbin_intervals <- renderUI({ ncol <- as.integer(input$bin_intervals) + 1 lapply(1:ncol, function(i) { numericInput(paste("n_bin_int", i), label = paste0("Int ", i), value = 1) }) }) binints <- reactive({ ncol <- as.integer(input$bin_intervals) + 1 collect <- list(lapply(1:ncol, function(i) { input[[paste("n_bin_int", i)]] })) colors <- unlist(collect) }) # dynamic UI for legend names output$ui_hist_legnames <- renderUI({ ncol <- as.integer(input$hist_leg_names) lapply(1:ncol, function(i) { textInput(paste("n_nameshist_", i), label = paste0("Legend Name ", i)) }) }) # dynamic UI for legend border output$ui_hist_legpoint <- renderUI({ ncol <- as.integer(input$hist_leg_point) lapply(1:ncol, function(i) { numericInput(paste("n_pointhist_", i), label = paste0("Legend Point ", i), value = 1) }) }) # vector of legend names name_hist <- reactive({ ncol <- as.integer(input$hist_leg_names) collect <- list(lapply(1:ncol, function(i) { input[[paste("n_nameshist_", i)]] })) names <- unlist(collect) }) # vector of point types point_hist <- reactive({ ncol <- as.integer(input$hist_leg_point) collect <- list(lapply(1:ncol, function(i) { input[[paste("n_pointhist_", i)]] })) names <- unlist(collect) }) # frequency table h <- reactive({ freq_cont(hist_data(), as.character(input$hist_select), input$nbins) }) binner <- reactive({ if (input$bin_opt == 'Bins') { binners <- h()$bins } else if (input$bin_opt == 'Algorithms') { binners <- input$alg_options } else { binners <- binints() } return(binners) }) ymax <- reactive({ if(input$hist_frequency) { max(hist(h()$data, probability = T)$density) + 0.02 } else { max(h()$cumulative) + 2 } }) # histogram output$hist_1 <- renderPlot({ hist_plot(h()$data, bins = h()$bins, title = input$hist_title, xlab = input$hist_xlabel, ylab = input$hist_ylabel, ylimit = c(0, ymax()), probability = input$hist_frequency, right = input$hist_interval, axes = input$hist_hideaxes, labels = as.logical(input$hist_showlabels)) }) output$hist_2 <- renderPlot({ hist_plot(h()$dat, binner(), input$hist_title, input$hist_xlabel, input$hist_ylabel, ylimit = c(0, ymax()), input$hist_frequency, input$hist_interval, input$hist_hideaxes, as.logical(input$hist_showlabels)) }) output$hist_3 <- renderPlot({ hist_plot(h()$dat, binner(), input$hist_title, input$hist_xlabel, input$hist_ylabel, ylimit = c(0, ymax()), input$hist_frequency, input$hist_interval, input$hist_hideaxes, as.logical(input$hist_showlabels), colours_hist(), borders_hist()) }) output$hist_4 <- renderPlot({ hist_plot(h()$dat, binner(), input$hist_title, input$hist_xlabel, input$hist_ylabel, ylimit = c(0, ymax()), input$hist_frequency, input$hist_interval, input$hist_hideaxes, as.logical(input$hist_showlabels), colours_hist(), borders_hist(), leg = input$hist_leg_yn, leg_x = input$hist_leg_x, leg_y = input$hist_leg_y, legend = name_hist(), leg_point = point_hist(), leg_colour = colours_hist(), leg_boxtype = input$hist_leg_boxtype, leg_boxcol = input$hist_leg_boxcol, leg_boxlty = input$hist_leg_boxlty, leg_boxlwd = input$hist_leg_boxlwd, leg_boxborcol = input$hist_leg_boxborcol, leg_boxxjust = input$hist_leg_boxxjust, leg_boxyjust = input$hist_leg_boxyjust, leg_textcol = input$hist_leg_textcol, leg_textfont = input$hist_leg_textfont, leg_textcolumns = input$hist_leg_textcolumns, leg_texthoriz = input$hist_leg_texthoriz, leg_title = input$hist_leg_title, leg_titlecol = input$hist_leg_titlecol, leg_textadj = input$hist_leg_textadj) }) output$hist_5 <- renderPlot({ hist_plot(h()$dat, binner(), input$hist_title, input$hist_xlabel, input$hist_ylabel, ylimit = c(0, ymax()), input$hist_frequency, input$hist_interval, input$hist_hideaxes, as.logical(input$hist_showlabels), colours_hist(), borders_hist(), leg = input$hist_leg_yn, leg_x = input$hist_leg_x, leg_y = input$hist_leg_y, legend = name_hist(), leg_point = point_hist(), leg_colour = colours_hist(), leg_boxtype = input$hist_leg_boxtype, leg_boxcol = input$hist_leg_boxcol, leg_boxlty = input$hist_leg_boxlty, leg_boxlwd = input$hist_leg_boxlwd, leg_boxborcol = input$hist_leg_boxborcol, leg_boxxjust = input$hist_leg_boxxjust, leg_boxyjust = input$hist_leg_boxyjust, leg_textcol = input$hist_leg_textcol, leg_textfont = input$hist_leg_textfont, leg_textcolumns = input$hist_leg_textcolumns, leg_texthoriz = input$hist_leg_texthoriz, leg_title = input$hist_leg_title, leg_titlecol = input$hist_leg_titlecol, leg_textadj = input$hist_leg_textadj, text_p = input$bbox_plottext, text_x_loc = input$bbox_text_x_loc, text_y_loc = input$bbox_text_y_loc, text_col = input$bbox_textcolor, text_font = input$bbox_textfont, text_size = input$bbox_textsize, m_text = input$bbox_mtextplot, m_side = input$bbox_mtext_side, m_line = input$bbox_mtext_line, m_adj = input$bbox_mtextadj, m_col = input$bbox_mtextcolor, m_font = input$bbox_mtextfont, m_cex = input$bbox_mtextsize) }) output$hist_6 <- renderPlot({ hist_plot(h()$dat, binner(), input$hist_title, input$hist_xlabel, input$hist_ylabel, ylimit = c(0, ymax()), input$hist_frequency, input$hist_interval, input$hist_hideaxes, as.logical(input$hist_showlabels), colours_hist(), borders_hist(), input$hist_coltitle, input$hist_colsub, input$hist_colaxis, input$hist_collabel, fontmain = input$hist_fontmain, fontsub = input$hist_fontsub, fontaxis = input$hist_fontaxis, fontlab = input$hist_fontlab, input$hist_cexmain, input$hist_cexsub, input$hist_cexaxis, input$hist_cexlab, leg = input$hist_leg_yn, leg_x = input$hist_leg_x, leg_y = input$hist_leg_y, legend = name_hist(), leg_point = point_hist(), leg_colour = colours_hist(), leg_boxtype = input$hist_leg_boxtype, leg_boxcol = input$hist_leg_boxcol, leg_boxlty = input$hist_leg_boxlty, leg_boxlwd = input$hist_leg_boxlwd, leg_boxborcol = input$hist_leg_boxborcol, leg_boxxjust = input$hist_leg_boxxjust, leg_boxyjust = input$hist_leg_boxyjust, leg_textcol = input$hist_leg_textcol, leg_textfont = input$hist_leg_textfont, leg_textcolumns = input$hist_leg_textcolumns, leg_texthoriz = input$hist_leg_texthoriz, leg_title = input$hist_leg_title, leg_titlecol = input$hist_leg_titlecol, leg_textadj = input$hist_leg_textadj, text_p = input$bbox_plottext, text_x_loc = input$bbox_text_x_loc, text_y_loc = input$bbox_text_y_loc, text_col = input$bbox_textcolor, text_font = input$bbox_textfont, text_size = input$bbox_textsize, m_text = input$bbox_mtextplot, m_side = input$bbox_mtext_side, m_line = input$bbox_mtext_line, m_adj = input$bbox_mtextadj, m_col = input$bbox_mtextcolor, m_font = input$bbox_mtextfont, m_cex = input$bbox_mtextsize) }) output$hist_final <- renderPlot({ hist_plot(h()$dat, binner(), input$hist_title, input$hist_xlabel, input$hist_ylabel, ylimit = c(0, ymax()), input$hist_frequency, input$hist_interval, input$hist_hideaxes, as.logical(input$hist_showlabels), colours_hist(), borders_hist(), input$hist_coltitle, input$hist_colsub, input$hist_colaxis, input$hist_collabel, fontmain = input$hist_fontmain, fontsub = input$hist_fontsub, fontaxis = input$hist_fontaxis, fontlab = input$hist_fontlab, input$hist_cexmain, input$hist_cexsub, input$hist_cexaxis, input$hist_cexlab, leg = input$hist_leg_yn, leg_x = input$lhist_leg_x, leg_y = input$hist_leg_y, legend = name_hist(), leg_point = point_hist(), leg_colour = colours_hist(), leg_boxtype = input$hist_leg_boxtype, leg_boxcol = input$hist_leg_boxcol, leg_boxlty = input$hist_leg_boxlty, leg_boxlwd = input$hist_leg_boxlwd, leg_boxborcol = input$hist_leg_boxborcol, leg_boxxjust = input$hist_leg_boxxjust, leg_boxyjust = input$hist_leg_boxyjust, leg_textcol = input$hist_leg_textcol, leg_textfont = input$hist_leg_textfont, leg_textcolumns = input$hist_leg_textcolumns, leg_texthoriz = input$hist_leg_texthoriz, leg_title = input$hist_leg_title, leg_titlecol = input$hist_leg_titlecol, leg_textadj = input$hist_leg_textadj, text_p = input$bbox_plottext, text_x_loc = input$bbox_text_x_loc, text_y_loc = input$bbox_text_y_loc, text_col = input$bbox_textcolor, text_font = input$bbox_textfont, text_size = input$bbox_textsize, m_text = input$bbox_mtextplot, m_side = input$bbox_mtext_side, m_line = input$bbox_mtext_line, m_adj = input$bbox_mtextadj, m_col = input$bbox_mtextcolor, m_font = input$bbox_mtextfont, m_cex = input$bbox_mtextsize) })
/scratch/gouwar.j/cran-all/cranData/xplorerr/inst/app-visualize/logic/logic_hist.R
source('helper/histly.R') source('helper/bohist.R') source('helper/highhist.R') observeEvent(input$finalok, { num_data <- final_split$train[, sapply(final_split$train, is.numeric)] if (is.null(dim(num_data))) { k <- final_split$train %>% map(is.numeric) %>% unlist() j <- names(which(k == TRUE)) numdata <- tibble::as_data_frame(num_data) colnames(numdata) <- j updateSelectInput(session, 'histly_select_x', choices = names(numdata), selected = names(numdata)) updateSelectInput(session, 'bohist_select_x', choices = names(numdata), selected = names(numdata)) updateSelectInput(session, 'hihist_select_x', choices = names(numdata), selected = names(numdata)) } else if (ncol(num_data) < 1) { updateSelectInput(session, 'histly_select_x', choices = '', selected = '') updateSelectInput(session, 'bohist_select_x', choices = '', selected = '') updateSelectInput(session, 'hihist_select_x', choices = '', selected = '') } else { updateSelectInput(session, 'histly_select_x', choices = names(num_data)) updateSelectInput(session, 'bohist_select_x', choices = names(num_data)) updateSelectInput(session, 'hihist_select_x', choices = names(num_data)) } }) observeEvent(input$submit_part_train_per, { num_data <- final_split$train[, sapply(final_split$train, is.numeric)] if (is.null(dim(num_data))) { k <- final_split$train %>% map(is.numeric) %>% unlist() j <- names(which(k == TRUE)) numdata <- tibble::as_data_frame(num_data) colnames(numdata) <- j updateSelectInput(session, 'histly_select_x', choices = names(numdata), selected = names(numdata)) updateSelectInput(session, 'bohist_select_x', choices = names(numdata), selected = names(numdata)) updateSelectInput(session, 'hihist_select_x', choices = names(numdata), selected = names(numdata)) } else if (ncol(num_data) < 1) { updateSelectInput(session, 'histly_select_x', choices = '', selected = '') updateSelectInput(session, 'bohist_select_x', choices = '', selected = '') updateSelectInput(session, 'hihist_select_x', choices = '', selected = '') } else { updateSelectInput(session, 'histly_select_x', choices = names(num_data)) updateSelectInput(session, 'bohist_select_x', choices = names(num_data)) updateSelectInput(session, 'hihist_select_x', choices = names(num_data)) } }) histlydata <- reactive({ req(input$histly_select_x) final_split$train[, input$histly_select_x] }) observe({ updateNumericInput(session, "histly_binstart", value = min(histlydata())) updateNumericInput(session, "histly_binend", value = max(histlydata())) }) output$histly_plot_1 <- plotly::renderPlotly({ if (input$histly_auto == TRUE) { histly(data = final_split$train, y = input$histly_select_x, title = input$histly_title, x_title = input$histly_xlabel, hist_col = input$histly_color, y_title = input$histly_ylabel, hist_orient = input$histly_horiz, hist_opacity = input$histly_opacity, hist_type = input$histly_type, auto_binx = input$histly_auto) } else { histly(data = final_split$train, y = input$histly_select_x, title = input$histly_title, x_title = input$histly_xlabel, hist_col = input$histly_color, y_title = input$histly_ylabel, hist_orient = input$histly_horiz, hist_opacity = input$histly_opacity, hist_type = input$histly_type, auto_binx = input$histly_auto, xbins_size = input$histly_binsize, xbins_start = input$histly_binstart, xbins_end = input$histly_binend) } }) output$bohist_plot_1 <- rbokeh::renderRbokeh({ bohist(data = final_split$train, x_data = input$bohist_select_x, fig_title = input$bohist_title, x_lab = input$bohist_xlabel, y_lab = input$bohist_ylabel, h_breaks = input$bohist_breaks, h_freq = input$bohist_density, h_incl_low = input$bohist_lowest, h_right = input$bohist_right, h_fill_col = input$bohist_color, add_density = input$bohist_add, den_col = input$bohist_dcolor, den_alpha = input$bohist_dalpha, den_width = input$bohist_dwidth, den_type = input$bohist_dtype) }) output$hihist_plot_1 <- highcharter::renderHighchart({ highist(data = final_split$train, column = input$hihist_select_x, xlab = input$hihist_xlabel, color = input$hihist_color) })
/scratch/gouwar.j/cran-all/cranData/xplorerr/inst/app-visualize/logic/logic_hist_prh.R
eda_menu <- eventReactive(input$click_descriptive, { fluidRow( column(12), br(), column(12, align = 'center', h5('What do you want to do?') ), br(), br(), br(), column(3), column(4, align = 'left', h5('Generate detailed descriptive statistics for a continuous variable: ') ), column(2, align = 'left', actionButton( inputId = 'button_1', label = 'Click Here', width = '120px' ) ), column(3), br(), br(), br(), column(3), column(4, align = 'left', h5('Generate frequency distribution of a categorical variable: ') ), column(2, align = 'left', actionButton( inputId = 'button_2', label = 'Click Here', width = '120px' ) ), column(3), br(), br(), br(), column(3), column(4, align = 'left', h5('Generate frequency distribution a continuous variable: ') ), column(2, align = 'left', actionButton( inputId = 'button_3', label = 'Click Here', width = '120px' ) ), column(3), br(), br(), br(), column(3), column(4, align = 'left', h5('Generate two way table of categorical variables: ') ), column(2, align = 'left', actionButton( inputId = 'button_4', label = 'Click Here', width = '120px' ) ), column(3), br(), br(), br(), column(3), column(4, align = 'left', h5('Generate multiple one way tables of categorical variables: ') ), column(2, align = 'left', actionButton( inputId = 'button_5', label = 'Click Here', width = '120px' ) ), column(3), br(), br(), br(), column(3), column(4, align = 'left', h5('Generate multiple two way tables of categorical variables: ') ), column(2, align = 'left', actionButton( inputId = 'button_6', label = 'Click Here', width = '120px' ) ), column(3), br(), br(), br(), column(3), column(4, align = 'left', h5('Generate grouped summary statistics: ') ), column(2, align = 'left', actionButton( inputId = 'button_7', label = 'Click Here', width = '120px' ) ), column(3) ) }) output$eda_options <- renderUI({ eda_menu() }) observeEvent(input$click_descriptive, { updateNavbarPage(session, 'mainpage', selected = 'tab_home_analyze') updateNavlistPanel(session, 'navlist_home', 'tab_eda_home') }) observeEvent(input$click_distributions, { updateNavbarPage(session, 'mainpage', selected = 'tab_home_analyze') updateNavlistPanel(session, 'navlist_home', 'tab_dist_home') }) observeEvent(input$click_inference, { updateNavbarPage(session, 'mainpage', selected = 'tab_home_analyze') updateNavlistPanel(session, 'navlist_home', 'tab_infer_home') }) observeEvent(input$click_model, { updateNavbarPage(session, 'mainpage', selected = 'tab_home_analyze') updateNavlistPanel(session, 'navlist_home', 'tab_model_home') }) observeEvent(input$click_visualize, { updateNavbarPage(session, 'mainpage', selected = 'tab_viz_home') updateNavlistPanel(session, 'navlist_vizmenu', 'tab_home_viz') }) # observeEvent(input$click_visualize, { # updateNavbarPage(session, 'mainpage', selected = 'tab_viz_lib') # }) observeEvent(input$button_1, { updateNavbarPage(session, 'mainpage', selected = 'tab_eda') updateNavlistPanel(session, 'navlist_eda', 'tab_summary') }) observeEvent(input$button_2, { updateNavbarPage(session, 'mainpage', selected = 'tab_eda') updateNavlistPanel(session, 'navlist_eda', 'tab_fqual') }) observeEvent(input$button_3, { updateNavbarPage(session, 'mainpage', selected = 'tab_eda') updateNavlistPanel(session, 'navlist_eda', 'tab_fquant') }) observeEvent(input$button_4, { updateNavbarPage(session, 'mainpage', selected = 'tab_eda') updateNavlistPanel(session, 'navlist_eda', 'tab_cross') }) observeEvent(input$button_5, { updateNavbarPage(session, 'mainpage', selected = 'tab_eda') updateNavlistPanel(session, 'navlist_eda', 'tab_mult1') }) observeEvent(input$button_6, { updateNavbarPage(session, 'mainpage', selected = 'tab_eda') updateNavlistPanel(session, 'navlist_eda', 'tab_mult2') }) observeEvent(input$button_7, { updateNavbarPage(session, 'mainpage', selected = 'tab_eda') updateNavlistPanel(session, 'navlist_eda', 'tab_gsummary') }) observeEvent(input$button_dist_home_1, { updateNavbarPage(session, 'mainpage', selected = 'tab_dist') updateNavlistPanel(session, 'navlist_dist', 'tab_norm') }) observeEvent(input$button_dist_home_2, { updateNavbarPage(session, 'mainpage', selected = 'tab_dist') updateNavlistPanel(session, 'navlist_dist', 'tab_t') }) observeEvent(input$button_dist_home_3, { updateNavbarPage(session, 'mainpage', selected = 'tab_dist') updateNavlistPanel(session, 'navlist_dist', 'tab_chisq') }) observeEvent(input$button_dist_home_4, { updateNavbarPage(session, 'mainpage', selected = 'tab_dist') updateNavlistPanel(session, 'navlist_dist', 'tab_binom') }) observeEvent(input$button_dist_home_5, { updateNavbarPage(session, 'mainpage', selected = 'tab_dist') updateNavlistPanel(session, 'navlist_dist', 'tab_f') }) observeEvent(input$button_infer_home_1, { updateNavbarPage(session, 'mainpage', selected = 'tab_home_analyze') updateNavlistPanel(session, 'navlist_home', 'tab_infer1_home') }) observeEvent(input$button_infer_home_2, { updateNavbarPage(session, 'mainpage', selected = 'tab_home_analyze') updateNavlistPanel(session, 'navlist_home', 'tab_infer2_home') }) observeEvent(input$button_infer_home_3, { updateNavbarPage(session, 'mainpage', selected = 'tab_home_analyze') updateNavlistPanel(session, 'navlist_home', 'tab_infer3_home') }) # links for inferential statistics observeEvent(input$inf_menu_1_t, { updateNavbarPage(session, 'mainpage', selected = 'tab_infer') updateNavlistPanel(session, 'navlist_infer', 'tab_ttest') }) observeEvent(input$inf_menu_1_var, { updateNavbarPage(session, 'mainpage', selected = 'tab_infer') updateNavlistPanel(session, 'navlist_infer', 'tab_osvartest') }) observeEvent(input$inf_menu_1_prop, { updateNavbarPage(session, 'mainpage', selected = 'tab_infer') updateNavlistPanel(session, 'navlist_infer', 'tab_osproptest') }) observeEvent(input$inf_menu_1_chi, { updateNavbarPage(session, 'mainpage', selected = 'tab_infer') updateNavlistPanel(session, 'navlist_infer', 'tab_chigof') }) observeEvent(input$inf_menu_1_runs, { updateNavbarPage(session, 'mainpage', selected = 'tab_infer') updateNavlistPanel(session, 'navlist_infer', 'tab_runs') }) observeEvent(input$inf_menu_2_it, { updateNavbarPage(session, 'mainpage', selected = 'tab_infer') updateNavlistPanel(session, 'navlist_infer', 'tab_indttest') }) observeEvent(input$inf_menu_2_pt, { updateNavbarPage(session, 'mainpage', selected = 'tab_infer') updateNavlistPanel(session, 'navlist_infer', 'tab_indttest') }) observeEvent(input$inf_menu_2_binom, { updateNavbarPage(session, 'mainpage', selected = 'tab_infer') updateNavlistPanel(session, 'navlist_infer', 'tab_binomtest') }) observeEvent(input$inf_menu_2_var, { updateNavbarPage(session, 'mainpage', selected = 'tab_infer') updateNavlistPanel(session, 'navlist_infer', 'tab_tsvartest') }) observeEvent(input$inf_menu_2_prop, { updateNavbarPage(session, 'mainpage', selected = 'tab_infer') updateNavlistPanel(session, 'navlist_infer', 'tab_tsproptest') }) observeEvent(input$inf_menu_2_chi, { updateNavbarPage(session, 'mainpage', selected = 'tab_infer') updateNavlistPanel(session, 'navlist_infer', 'tab_chict') }) observeEvent(input$inf_menu_2_mcnemar, { updateNavbarPage(session, 'mainpage', selected = 'tab_infer') updateNavlistPanel(session, 'navlist_infer', 'tab_mcnemar') }) observeEvent(input$inf_menu_3_anova, { updateNavbarPage(session, 'mainpage', selected = 'tab_infer') updateNavlistPanel(session, 'navlist_infer', 'tab_anova') }) observeEvent(input$inf_menu_3_levene, { updateNavbarPage(session, 'mainpage', selected = 'tab_infer') updateNavlistPanel(session, 'navlist_infer', 'tab_levtest') }) observeEvent(input$inf_menu_3_cochran, { updateNavbarPage(session, 'mainpage', selected = 'tab_infer') updateNavlistPanel(session, 'navlist_infer', 'tab_cochran') }) ## visulization links observeEvent(input$click_base, { updateNavbarPage(session, 'mainpage', selected = 'tab_viz_home') updateNavlistPanel(session, 'navlist_vizmenu', 'tab_viz_base') }) observeEvent(input$click_ggplot2, { updateNavbarPage(session, 'mainpage', selected = 'tab_viz_home') updateNavlistPanel(session, 'navlist_vizmenu', 'tab_viz_gg') }) observeEvent(input$click_prh, { updateNavbarPage(session, 'mainpage', selected = 'tab_viz_home') updateNavlistPanel(session, 'navlist_vizmenu', 'tab_viz_others') }) ## link viz libraries to tabs observeEvent(input$click_bar_base, { updateNavbarPage(session, 'mainpage', selected = 'tab_base') updateNavlistPanel(session, 'navlist_base', 'tab_bar') }) observeEvent(input$click_bar2_base, { updateNavbarPage(session, 'mainpage', selected = 'tab_base') updateNavlistPanel(session, 'navlist_base', 'tab_bar2') }) observeEvent(input$click_box_base, { updateNavbarPage(session, 'mainpage', selected = 'tab_base') updateNavlistPanel(session, 'navlist_base', 'tab_box') }) observeEvent(input$click_box2_base, { updateNavbarPage(session, 'mainpage', selected = 'tab_base') updateNavlistPanel(session, 'navlist_base', 'tab_box2') }) observeEvent(input$click_line_base, { updateNavbarPage(session, 'mainpage', selected = 'tab_base') updateNavlistPanel(session, 'navlist_base', 'tab_line') }) observeEvent(input$click_scatter_base, { updateNavbarPage(session, 'mainpage', selected = 'tab_base') updateNavlistPanel(session, 'navlist_base', 'tab_scatter') }) observeEvent(input$click_hist_base, { updateNavbarPage(session, 'mainpage', selected = 'tab_base') updateNavlistPanel(session, 'navlist_base', 'tab_hist') }) observeEvent(input$click_pie_base, { updateNavbarPage(session, 'mainpage', selected = 'tab_base') updateNavlistPanel(session, 'navlist_base', 'tab_pie') }) observeEvent(input$click_pie2_base, { updateNavbarPage(session, 'mainpage', selected = 'tab_base') updateNavlistPanel(session, 'navlist_base', 'tab_pie3d') }) ## ggplot2 observeEvent(input$click_bar_gg, { updateNavbarPage(session, 'mainpage', selected = 'tab_gg') updateNavlistPanel(session, 'navlist_gg', 'tab_gbar') }) observeEvent(input$click_bar2_gg, { updateNavbarPage(session, 'mainpage', selected = 'tab_gg') updateNavlistPanel(session, 'navlist_gg', 'tab_gbar2') }) observeEvent(input$click_box_gg, { updateNavbarPage(session, 'mainpage', selected = 'tab_gg') updateNavlistPanel(session, 'navlist_gg', 'tab_gbox') }) observeEvent(input$click_box2_gg, { updateNavbarPage(session, 'mainpage', selected = 'tab_gg') updateNavlistPanel(session, 'navlist_gg', 'tab_gbox2') }) observeEvent(input$click_line_gg, { updateNavbarPage(session, 'mainpage', selected = 'tab_gg') updateNavlistPanel(session, 'navlist_gg', 'tab_gline1') }) observeEvent(input$click_scatter_gg, { updateNavbarPage(session, 'mainpage', selected = 'tab_gg') updateNavlistPanel(session, 'navlist_gg', 'tab_gscatter') }) observeEvent(input$click_hist_gg, { updateNavbarPage(session, 'mainpage', selected = 'tab_gg') updateNavlistPanel(session, 'navlist_gg', 'tab_ghist') }) observeEvent(input$click_pie_gg, { updateNavbarPage(session, 'mainpage', selected = 'tab_gg') updateNavlistPanel(session, 'navlist_gg', 'tab_gpie') }) observeEvent(input$click_line2_gg, { updateNavbarPage(session, 'mainpage', selected = 'tab_gg') updateNavlistPanel(session, 'navlist_gg', 'tab_gline2') }) ## others observeEvent(input$click_bar_others, { updateNavbarPage(session, 'mainpage', selected = 'tab_others') updateNavlistPanel(session, 'navlist_others', 'tab_bar_plot_1') }) observeEvent(input$click_bar2_others, { updateNavbarPage(session, 'mainpage', selected = 'tab_others') updateNavlistPanel(session, 'navlist_others', 'tab_bar_plot_2') }) observeEvent(input$click_box_others, { updateNavbarPage(session, 'mainpage', selected = 'tab_others') updateNavlistPanel(session, 'navlist_others', 'tab_box_plot_1') }) observeEvent(input$click_box2_others, { updateNavbarPage(session, 'mainpage', selected = 'tab_others') updateNavlistPanel(session, 'navlist_others', 'tab_box_plot_2') }) observeEvent(input$click_line_others, { updateNavbarPage(session, 'mainpage', selected = 'tab_others') updateNavlistPanel(session, 'navlist_others', 'tab_line_prh') }) observeEvent(input$click_scatter_others, { updateNavbarPage(session, 'mainpage', selected = 'tab_others') updateNavlistPanel(session, 'navlist_others', 'tab_scatter_prh') }) observeEvent(input$click_hist_others, { updateNavbarPage(session, 'mainpage', selected = 'tab_others') updateNavlistPanel(session, 'navlist_others', 'tab_hist_prh') }) observeEvent(input$click_pie_others, { updateNavbarPage(session, 'mainpage', selected = 'tab_others') updateNavlistPanel(session, 'navlist_others', 'tab_pie_prh') }) ## model links observeEvent(input$model_reg_click, { updateNavbarPage(session, 'mainpage', selected = 'tab_reg') updateNavlistPanel(session, 'navlist_reg', 'tab_regress') }) observeEvent(input$model_varsel_click, { updateNavbarPage(session, 'mainpage', selected = 'tab_reg') updateNavlistPanel(session, 'navlist_reg', 'tab_var_select') }) observeEvent(input$model_resdiag_click, { updateNavbarPage(session, 'mainpage', selected = 'tab_reg') updateNavlistPanel(session, 'navlist_reg', 'tab_res_diag') }) observeEvent(input$model_het_click, { updateNavbarPage(session, 'mainpage', selected = 'tab_reg') updateNavlistPanel(session, 'navlist_reg', 'tab_hetero') }) observeEvent(input$model_coldiag_click, { updateNavbarPage(session, 'mainpage', selected = 'tab_reg') updateNavlistPanel(session, 'navlist_reg', 'tab_regcollin') }) observeEvent(input$model_infl_click, { updateNavbarPage(session, 'mainpage', selected = 'tab_reg') updateNavlistPanel(session, 'navlist_reg', 'tab_inflobs') }) observeEvent(input$model_fit_click, { updateNavbarPage(session, 'mainpage', selected = 'tab_reg') updateNavlistPanel(session, 'navlist_reg', 'tab_mfit') }) observeEvent(input$model_varcontrib_click, { updateNavbarPage(session, 'mainpage', selected = 'tab_reg') updateNavlistPanel(session, 'navlist_reg', 'tab_regvarcont') })
/scratch/gouwar.j/cran-all/cranData/xplorerr/inst/app-visualize/logic/logic_home.R
source("helper/line-plot.R") # update variable selection for scatter plots # observe({ # updateSelectInput(session, 'line_select_x', choices = names(data())) # updateSelectInput(session, 'line_select_y', choices = names(data())) # }) observeEvent(input$finalok, { num_data <- cbind.data.frame(final_split$train[, sapply(final_split$train, is.numeric)], final_split$train[, sapply(final_split$train, is.Date)]) k <- final_split$train %>% map(is.numeric) %>% unlist() t <- final_split$train %>% map(is.Date) %>% unlist() j1 <- names(which(k == TRUE)) j2 <- names(which(t == TRUE)) if (length(j1) == 0) { j <- j2 } else if (length(j2) == 0) { j <- j1 } else { j <- c(j1, j2) } colnames(num_data) <- j if (is.null(dim(num_data))) { numdata <- tibble::as_data_frame(num_data) updateSelectInput(session, 'line_select_x', choices = names(numdata), selected = names(numdata)) updateSelectInput(session, 'line_select_y', choices = names(numdata), selected = names(numdata)) } else if (ncol(num_data) < 1) { updateSelectInput(session, 'line_select_x', choices = '', selected = '') updateSelectInput(session, 'line_select_y', choices = '', selected = '') } else { updateSelectInput(session, 'line_select_x', choices = names(num_data)) updateSelectInput(session, 'line_select_y', choices = names(num_data)) } }) observeEvent(input$submit_part_train_per, { num_data <- cbind.data.frame(final_split$train[, sapply(final_split$train, is.numeric)], final_split$train[, sapply(final_split$train, is.Date)]) k <- final_split$train %>% map(is.numeric) %>% unlist() t <- final_split$train %>% map(is.Date) %>% unlist() j1 <- names(which(k == TRUE)) j2 <- names(which(t == TRUE)) if (length(j1) == 0) { j <- j2 } else if (length(j2) == 0) { j <- j1 } else { j <- c(j1, j2) } colnames(num_data) <- j if (is.null(dim(num_data))) { numdata <- tibble::as_data_frame(num_data) updateSelectInput(session, 'line_select_x', choices = names(numdata), selected = names(numdata)) updateSelectInput(session, 'line_select_y', choices = names(numdata), selected = names(numdata)) } else if (ncol(num_data) < 1) { updateSelectInput(session, 'line_select_x', choices = '', selected = '') updateSelectInput(session, 'line_select_y', choices = '', selected = '') } else { updateSelectInput(session, 'line_select_x', choices = names(num_data)) updateSelectInput(session, 'line_select_y', choices = names(num_data)) } }) # selected data selected_xl <- reactive({ req(input$line_select_x) final_split$train[, input$line_select_x] }) selected_yl <- reactive({ req(input$line_select_y) final_split$train[, input$line_select_y] }) # dynamic UI for line colors output$ui_nlines <- renderUI({ ncol <- as.integer(input$n_lines) if (ncol < 1) { NULL } else { lapply(1:ncol, function(i) { selectInput(paste("n_addline_", i), label = paste0("Line ", i), choices = names(final_split$train)) }) } }) addvars <- reactive({ ncol <- as.integer(input$n_lines) if (ncol < 1) { colors <- NULL } else { collect <- list(lapply(1:ncol, function(i) { input[[paste("n_addline_", i)]] })) colors <- unlist(collect) } colors }) # dynamic UI for bar colors output$ui_ncolors <- renderUI({ ncol <- as.integer(input$n_lines) if (ncol < 1) { NULL } else { lapply(1:ncol, function(i) { textInput(paste("n_addcol_", i), label = paste0("Line ", i, " Color"), value = "black") }) } }) colours <- reactive({ ncol <- as.integer(input$n_lines) if (ncol < 1) { colors <- NULL } else { collect <- list(lapply(1:ncol, function(i) { input[[paste("n_addcol_", i)]] })) colors <- unlist(collect) } colors }) selected_z <- reactive({ # final_split$train[, addvars()] ncol <- as.integer(input$n_lines) if (ncol > 0) { if (ncol == 1) { final_split$train %>% select_(addvars()) } else { final_split$train[, addvars()] } } }) nz <- reactive({ ncol(selected_z()) }) output$ui_nltys <- renderUI({ ncol <- as.integer(input$n_lines) if (ncol < 1) { NULL } else { lapply(1:ncol, function(i) { numericInput(paste("n_addlty_", i), label = paste0("Line ", i, " Type"), value = 1, min = 1, max = 5, step = 1) }) } }) ltys <- reactive({ ncol <- as.integer(input$n_lines) if (ncol < 1) { colors <- NULL } else { collect <- list(lapply(1:ncol, function(i) { input[[paste("n_addlty_", i)]] })) colors <- unlist(collect) } colors }) output$ui_nlwds <- renderUI({ ncol <- as.integer(input$n_lines) if (ncol < 1) { NULL } else { lapply(1:ncol, function(i) { numericInput(paste("n_addlwd_", i), label = paste0("Line ", i, " Width"), value = 1, min = 0.1, step = 0.1) }) } }) lwds <- reactive({ ncol <- as.integer(input$n_lines) if (ncol < 1) { colors <- NULL } else { collect <- list(lapply(1:ncol, function(i) { input[[paste("n_addlwd_", i)]] })) colors <- unlist(collect) } colors }) output$ui_pcolors <- renderUI({ ncol <- as.integer(input$n_lines) if (ncol < 1) { NULL } else { lapply(1:ncol, function(i) { textInput(paste("n_addpcol_", i), label = paste0("Point ", i, " Color"), value = 'black') }) } }) pcolors <- reactive({ ncol <- as.integer(input$n_lines) if (ncol < 1) { colors <- NULL } else { collect <- list(lapply(1:ncol, function(i) { input[[paste("n_addpcol_", i)]] })) colors <- unlist(collect) } colors }) output$ui_pbgcolor <- renderUI({ ncol <- as.integer(input$n_lines) if (ncol < 1) { NULL } else { lapply(1:ncol, function(i) { textInput(paste("n_addpbgcol_", i), label = paste0("Point ", i, " Bg Col"), value = 'black') }) } }) pbgcolors <- reactive({ ncol <- as.integer(input$n_lines) if (ncol < 1) { colors <- NULL } else { collect <- list(lapply(1:ncol, function(i) { input[[paste("n_addpbgcol_", i)]] })) colors <- unlist(collect) } colors }) output$ui_psize <- renderUI({ ncol <- as.integer(input$n_lines) if (ncol < 1) { NULL } else { lapply(1:ncol, function(i) { numericInput(paste("n_addpsize_", i), label = paste0("Point ", i, " Size"), value = 1, min = 0.1, step = 0.1) }) } }) psizes <- reactive({ ncol <- as.integer(input$n_lines) if (ncol < 1) { colors <- NULL } else { collect <- list(lapply(1:ncol, function(i) { input[[paste("n_addpsize_", i)]] })) colors <- unlist(collect) } colors }) output$ui_pshape <- renderUI({ ncol <- as.integer(input$n_lines) if (ncol < 1) { NULL } else { lapply(1:ncol, function(i) { numericInput(paste("n_addpshape_", i), label = paste0("Point ", i, "Shape"), min = 0, max = 25, value = 1) }) } }) pshapes <- reactive({ ncol <- as.integer(input$n_lines) if (ncol < 1) { colors <- NULL } else { collect <- list(lapply(1:ncol, function(i) { input[[paste("n_addpshape_", i)]] })) colors <- unlist(collect) } colors }) # dynamic UI for legend names output$ui_line_legnames <- renderUI({ ncol <- as.integer(input$line_legnames) if (ncol < 1) { NULL } else { lapply(1:ncol, function(i) { textInput(paste("n_namesline_", i), label = paste0("Legend Name ", i)) }) } }) # dynamic UI for legend border output$ui_line_legpoint <- renderUI({ ncol <- as.integer(input$line_leg_point) if (ncol < 1) { NULL } else { lapply(1:ncol, function(i) { numericInput(paste("n_pointline_", i), label = paste0("Legend Point ", i), value = 15) }) } }) output$ui_line_legline <- renderUI({ ncol <- as.integer(input$line_leg_line) if (ncol < 1) { NULL } else { lapply(1:ncol, function(i) { numericInput(paste("n_lineline_", i), label = paste0("Legend Line ", i), value = 1) }) } }) # vector of legend names name_line <- reactive({ ncol <- as.integer(input$line_legnames) if (ncol < 1) { names <- NULL } else { collect <- list(lapply(1:ncol, function(i) { input[[paste("n_namesline_", i)]] })) names <- unlist(collect) } names }) # vector of point types point_line <- reactive({ ncol <- as.integer(input$line_leg_point) if (ncol < 1) { names <- NULL } else { collect <- list(lapply(1:ncol, function(i) { input[[paste("n_pointline_", i)]] })) names <- unlist(collect) } names }) line_line <- reactive({ ncol <- as.integer(input$line_leg_line) if (ncol < 1) { names <- NULL } else { collect <- list(lapply(1:ncol, function(i) { input[[paste("n_lineline_", i)]] })) names <- unlist(collect) } names }) output$ui_yrange_minl <- renderUI({ df <- final_split$train if (is.null(df)) return(NULL) numericInput('y_range_minl', 'Y Axis Min', value = min(as.numeric(selected_yl()))) }) output$ui_yrange_maxl <- renderUI({ df <- final_split$train if (is.null(df)) return(NULL) numericInput('y_range_maxl', 'Y Axis Max', value = max(as.numeric(selected_yl()))) }) limits <- reactive({ c(input$y_range_minl, input$y_range_maxl) }) # plot 1 output$line_plot_1 <- renderPlot({ line_graph(selected_xl(), selected_yl(), title = input$line_title, subtitle = input$line_subtitle, xlabel = input$line_xlabel, ylabel = input$line_ylabel) }) # plot 2 output$line_plot_2 <- renderPlot({ line_graph(selected_xl(), selected_yl(), input$line_type, input$line_width, input$line_color,title = input$line_title, subtitle = input$line_subtitle, xlabel = input$line_xlabel, ylabel = input$line_ylabel, input$add_points, input$point_shape, input$point_size, input$point_col, input$point_bg) }) # plot 3 output$line_plot_3 <- renderPlot({ # addvars() line_graph(selected_xl(), selected_yl(), input$line_type, input$line_width, input$line_color,title = input$line_title, sub = input$line_subtitle, xlab = input$line_xlabel, ylab = input$line_ylabel, input$add_points, input$point_shape, input$point_size, input$point_col, input$point_bg, ylim_l = limits()[1], ylim_u = limits()[2]) }) output$line_plot_4 <- renderPlot({ # addvars() line_graph(selected_xl(), selected_yl(), input$line_type, input$line_width, input$line_color,title = input$line_title, sub = input$line_subtitle, xlab = input$line_xlabel, ylab = input$line_ylabel, input$add_points, input$point_shape, input$point_size, input$point_col, input$point_bg, ylim_l = limits()[1], ylim_u = limits()[2], extra_lines = nz(), extra_vars = selected_z(), extra_cols = colours(), ltys = ltys(), lwds = lwds()) }) output$line_plot_5 <- renderPlot({ # addvars() line_graph(selected_xl(), selected_yl(), input$line_type, input$line_width, input$line_color,title = input$line_title, sub = input$line_subtitle, xlab = input$line_xlabel, ylab = input$line_ylabel, input$add_points, input$point_shape, input$point_size, input$point_col, input$point_bg, ylim_l = limits()[1], ylim_u = limits()[2], extra_lines = nz(), extra_vars = selected_z(), extra_cols = colours(), ltys = ltys(), lwds = lwds(), extra_p = input$extra_p, pcolors = pcolors(), pbgcolors = pbgcolors(), pshapes = pshapes(), psizes = psizes()) }) output$line_plot_6 <- renderPlot({ # addvars() line_graph(selected_xl(), selected_yl(), input$line_type, input$line_width, input$line_color,title = input$line_title, sub = input$line_subtitle, xlab = input$line_xlabel, ylab = input$line_ylabel, input$add_points, input$point_shape, input$point_size, input$point_col, input$point_bg, ylim_l = limits()[1], ylim_u = limits()[2], extra_lines = nz(), extra_vars = selected_z(), extra_cols = colours(), ltys = ltys(), lwds = lwds(), extra_p = input$extra_p, pcolors = pcolors(), pbgcolors = pbgcolors(), pshapes = pshapes(), psizes = psizes(), colmain = input$line_coltitle, colsub = input$line_colsub, colaxis = input$line_colaxis, collab = input$line_collabel, fontmain = input$line_fontmain, fontsub = input$line_fontsub, fontaxis = input$line_fontaxis, fontlab = input$line_fontlab, cexmain = input$line_cexmain, cexsub = input$line_cexsub, cexaxis = input$cexaxis, cexlab = input$cexlab) }) output$line_plot_7 <- renderPlot({ # addvars() line_graph(selected_xl(), selected_yl(), input$line_type, input$line_width, input$line_color,title = input$line_title, sub = input$line_subtitle, xlab = input$line_xlabel, ylab = input$line_ylabel, input$add_points, input$point_shape, input$point_size, input$point_col, input$point_bg, ylim_l = limits()[1], ylim_u = limits()[2], extra_lines = nz(), extra_vars = selected_z(), extra_cols = colours(), ltys = ltys(), lwds = lwds(), extra_p = input$extra_p, pcolors = pcolors(), pbgcolors = pbgcolors(), pshapes = pshapes(), psizes = psizes(), colmain = input$line_coltitle, colsub = input$line_colsub, colaxis = input$line_colaxis, collab = input$line_collabel, fontmain = input$line_fontmain, fontsub = input$line_fontsub, fontaxis = input$line_fontaxis, fontlab = input$line_fontlab, cexmain = input$line_cexmain, cexsub = input$line_cexsub, cexaxis = input$cexaxis, cexlab = input$cexlab, text_p = input$line_plottext, text_x_loc = input$line_text_x_loc, text_y_loc = input$line_text_y_loc, text_col = input$line_textcolor, text_font = input$line_textfont, text_size = input$line_textsize, m_text = input$line_mtextplot, m_side = input$line_mtext_side, m_line = input$line_mtext_line, m_adj = input$line_mtextadj, m_col = input$line_mtextcolor, m_font = input$line_mtextfont, m_cex = input$line_mtextsize) }) output$line_plot_8 <- renderPlot({ # addvars() line_graph(selected_xl(), selected_yl(), input$line_type, input$line_width, input$line_color,title = input$line_title, sub = input$line_subtitle, xlab = input$line_xlabel, ylab = input$line_ylabel, input$add_points, input$point_shape, input$point_size, input$point_col, input$point_bg, ylim_l = limits()[1], ylim_u = limits()[2], extra_lines = nz(), extra_vars = selected_z(), extra_cols = colours(), ltys = ltys(), lwds = lwds(), extra_p = input$extra_p, pcolors = pcolors(), pbgcolors = pbgcolors(), pshapes = pshapes(), psizes = psizes(), colmain = input$line_coltitle, colsub = input$line_colsub, colaxis = input$line_colaxis, collab = input$line_collabel, fontmain = input$line_fontmain, fontsub = input$line_fontsub, fontaxis = input$line_fontaxis, fontlab = input$line_fontlab, cexmain = input$line_cexmain, cexsub = input$line_cexsub, cexaxis = input$cexaxis, cexlab = input$cexlab, text_p = input$line_plottext, text_x_loc = input$line_text_x_loc, text_y_loc = input$line_text_y_loc, text_col = input$line_textcolor, text_font = input$line_textfont, text_size = input$line_textsize, m_text = input$line_mtextplot, m_side = input$line_mtext_side, m_line = input$line_mtext_line, m_adj = input$line_mtextadj, m_col = input$line_mtextcolor, m_font = input$line_mtextfont, m_cex = input$line_mtextsize, leg = as.logical(input$line_leg_yn), leg_x = input$line_leg_x, leg_y = input$line_leg_y, legend = name_line(), leg_line = line_line(), leg_point = point_line(), leg_colour = c(input$line_color, colours()), leg_boxtype = input$line_leg_boxtype, leg_boxcol = input$line_leg_boxcol, leg_boxlty = input$line_leg_boxlty, leg_boxlwd = input$line_leg_boxlwd, leg_boxborcol = input$line_leg_boxborcol, leg_boxxjust = input$line_leg_boxxjust, leg_boxyjust = input$line_leg_boxyjust, leg_textcol = input$line_leg_textcol, leg_textfont = input$line_leg_textfont, leg_textcolumns = input$line_leg_textcolumns, leg_texthoriz = input$line_leg_texthoriz, leg_title = input$line_leg_title, leg_titlecol = input$line_leg_titlecol, leg_textadj = input$line_leg_textadj) }) output$line_final <- renderPlot({ # addvars() line_graph(selected_xl(), selected_yl(), input$line_type, input$line_width, input$line_color,title = input$line_title, sub = input$line_subtitle, xlab = input$line_xlabel, ylab = input$line_ylabel, input$add_points, input$point_shape, input$point_size, input$point_col, input$point_bg, ylim_l = limits()[1], ylim_u = limits()[2], extra_lines = nz(), extra_vars = selected_z(), extra_cols = colours(), ltys = ltys(), lwds = lwds(), extra_p = input$extra_p, pcolors = pcolors(), pbgcolors = pbgcolors(), pshapes = pshapes(), psizes = psizes(), colmain = input$line_coltitle, colsub = input$line_colsub, colaxis = input$line_colaxis, collab = input$line_collabel, fontmain = input$line_fontmain, fontsub = input$line_fontsub, fontaxis = input$line_fontaxis, fontlab = input$line_fontlab, cexmain = input$line_cexmain, cexsub = input$line_cexsub, cexaxis = input$cexaxis, cexlab = input$cexlab, text_p = input$line_plottext, text_x_loc = input$line_text_x_loc, text_y_loc = input$line_text_y_loc, text_col = input$line_textcolor, text_font = input$line_textfont, text_size = input$line_textsize, m_text = input$line_mtextplot, m_side = input$line_mtext_side, m_line = input$line_mtext_line, m_adj = input$line_mtextadj, m_col = input$line_mtextcolor, m_font = input$line_mtextfont, m_cex = input$line_mtextsize, leg = as.logical(input$line_leg_yn), leg_x = input$line_leg_x, leg_y = input$line_leg_y, legend = name_line(), leg_line = line_line(), leg_point = point_line(), leg_colour = c(input$line_color, colours()), leg_boxtype = input$line_leg_boxtype, leg_boxcol = input$line_leg_boxcol, leg_boxlty = input$line_leg_boxlty, leg_boxlwd = input$line_leg_boxlwd, leg_boxborcol = input$line_leg_boxborcol, leg_boxxjust = input$line_leg_boxxjust, leg_boxyjust = input$line_leg_boxyjust, leg_textcol = input$line_leg_textcol, leg_textfont = input$line_leg_textfont, leg_textcolumns = input$line_leg_textcolumns, leg_texthoriz = input$line_leg_texthoriz, leg_title = input$line_leg_title, leg_titlecol = input$line_leg_titlecol, leg_textadj = input$line_leg_textadj) }) # # plot 4 # output$line_4 <- renderPlot({ # line_graph(selected_x(), selected_y(), input$line_style, input$line_type, input$line_width, # input$line_color,title = input$line_title, sub = input$line_subtitle, xlab = input$line_xlabel, # yalb = input$line_ylabel, input$add_points, input$point_shape, input$point_size, input$point_col, # input$point_bg, ylim_l = input$y_range_min, ylim_u = input$y_range_max, extra_lines = input$naddlines, # extra_vars = addvars(), extra_cols = colours(), leg = input$leg_yn, leg_x = input$leg_x, leg_y = input$leg_y, # legend = name(), leg_line = lines(), leg_point = point(), leg_colour = colours(), leg_boxtype = input$leg_boxtype, # leg_boxcol = input$leg_boxcol, leg_boxlty = input$leg_boxlty, leg_boxlwd = input$leg_boxlwd, # leg_boxborcol = input$leg_boxborcol, leg_boxxjust = input$leg_boxxjust, leg_boxyjust = input$leg_boxyjust, # leg_textcol = input$leg_textcol, leg_textfont = input$leg_textfont, leg_textcolumns = input$leg_textcolumns, # leg_texthoriz = input$leg_texthoriz, leg_title = input$leg_title, # leg_titlecol = input$leg_titlecol, leg_textadj = input$leg_textadj # ) # }) # # plot 5 # output$line_5 <- renderPlot({ # line_graph(selected_x(), selected_y(), input$line_style, input$line_type, input$line_width, # input$line_color,title = input$line_title, sub = input$line_subtitle, xlab = input$line_xlabel, # yalb = input$line_ylabel, input$add_points, input$point_shape, input$point_size, input$point_col, # input$point_bg, input$l_coltitle, input$l_colsub, input$l_colaxis, # input$l_collabel, input$l_fontmain, input$l_fontsub, # input$l_fontaxis, input$l_fontlab, input$l_cexmain, # input$l_cexsub, input$l_cexaxis, input$l_cexlab,ylim_l = input$y_range_min, ylim_u = input$y_range_max, extra_lines = input$naddlines, # extra_vars = addvars(), extra_cols = colours(), leg = input$leg_yn, leg_x = input$leg_x, leg_y = input$leg_y, # legend = name(), leg_line = lines(), leg_point = point(), leg_colour = colours(), leg_boxtype = input$leg_boxtype, # leg_boxcol = input$leg_boxcol, leg_boxlty = input$leg_boxlty, leg_boxlwd = input$leg_boxlwd, # leg_boxborcol = input$leg_boxborcol, leg_boxxjust = input$leg_boxxjust, leg_boxyjust = input$leg_boxyjust, # leg_textcol = input$leg_textcol, leg_textfont = input$leg_textfont, leg_textcolumns = input$leg_textcolumns, # leg_texthoriz = input$leg_texthoriz, leg_title = input$leg_title, # leg_titlecol = input$leg_titlecol, leg_textadj = input$leg_textadj, input$l_plottext, input$l_text_x_loc, input$l_text_y_loc, # input$l_textcolor, input$l_textfont, input$l_textsize, # input$l_mtextplot, input$l_mtext_side, input$l_mtext_line, # input$l_mtextadj, input$l_mtextcolor, input$l_mtextfont, # input$l_mtextsize # ) # }) # # final plot # output$line_final <- renderPlot({ # line_graph(selected_x(), selected_y(), input$line_style, input$line_type, input$line_width, # input$line_color,title = input$line_title, sub = input$line_subtitle, xlab = input$line_xlabel, # yalb = input$line_ylabel, input$add_points, input$point_shape, input$point_size, input$point_col, # input$point_bg, input$l_coltitle, input$l_colsub, input$l_colaxis, # input$l_collabel, input$l_fontmain, input$l_fontsub, # input$l_fontaxis, input$l_fontlab, input$l_cexmain, # input$l_cexsub, input$l_cexaxis, input$l_cexlab,ylim_l = input$y_range_min, ylim_u = input$y_range_max, extra_lines = input$naddlines, # extra_vars = addvars(), extra_cols = colours(), leg = input$leg_yn, leg_x = input$leg_x, leg_y = input$leg_y, # legend = name(), leg_line = lines(), leg_point = point(), leg_colour = colours(), leg_boxtype = input$leg_boxtype, # leg_boxcol = input$leg_boxcol, leg_boxlty = input$leg_boxlty, leg_boxlwd = input$leg_boxlwd, # leg_boxborcol = input$leg_boxborcol, leg_boxxjust = input$leg_boxxjust, leg_boxyjust = input$leg_boxyjust, # leg_textcol = input$leg_textcol, leg_textfont = input$leg_textfont, leg_textcolumns = input$leg_textcolumns, # leg_texthoriz = input$leg_texthoriz, leg_title = input$leg_title, # leg_titlecol = input$leg_titlecol, leg_textadj = input$leg_textadj, input$l_plottext, input$l_text_x_loc, input$l_text_y_loc, # input$l_textcolor, input$l_textfont, input$l_textsize, # input$l_mtextplot, input$l_mtext_side, input$l_mtext_line, # input$l_mtextadj, input$l_mtextcolor, input$l_mtextfont, # input$l_mtextsize # ) # }) # # plot download # output$line_downloadGraph <- downloadHandler( # filename <- function() { # paste(input$line_fileName, ".png") # }, # content <- function(file) { # png(file) # plot <- line_graph(selected_x(), selected_y(), input$line_style, # input$line_type, input$line_width, input$line_color, # input$line_title, input$line_subtitle, # input$line_xlabel, input$line_ylabel, input$line_coltitle, input$line_colsub, input$line_colaxis, # input$line_collabel, input$line_fontmain, input$line_fontsub, # input$line_fontaxis, input$line_fontlab, input$line_cexmain, # input$line_cexsub, input$line_cexaxis, input$line_cexlab, # input$line_plottext, input$line_text_x_loc, input$line_text_y_loc, # input$line_textcolor, input$line_textfont, input$line_textsize, # input$line_mtextplot, input$line_mtext_side, input$line_mtext_line, # input$line_mtextadj, input$line_mtextcolor, input$line_mtextfont, # input$line_mtextsize) # print(plot) # dev.off() # } # )
/scratch/gouwar.j/cran-all/cranData/xplorerr/inst/app-visualize/logic/logic_line.R
source('helper/linely.R') source('helper/boline.R') source('helper/highline.R') observeEvent(input$finalok, { num_data <- cbind.data.frame(final_split$train[, sapply(final_split$train, is.numeric)], final_split$train[, sapply(final_split$train, is.Date)]) k <- final_split$train %>% map(is.numeric) %>% unlist() t <- final_split$train %>% map(is.Date) %>% unlist() j1 <- names(which(k == TRUE)) j2 <- names(which(t == TRUE)) if (length(j1) == 0) { j <- j2 } else if (length(j2) == 0) { j <- j1 } else { j <- c(j1, j2) } colnames(num_data) <- j if (is.null(dim(num_data))) { numdata <- tibble::as_data_frame(num_data) updateSelectInput(session, 'linely_select_x', choices = names(numdata), selected = names(numdata)) updateSelectInput(session, 'linely_select_y', choices = names(numdata), selected = names(numdata)) updateSelectInput(session, 'boline_select_x', choices = names(numdata), selected = names(numdata)) updateSelectInput(session, 'boline_select_y', choices = names(numdata), selected = names(numdata)) updateSelectInput(session, 'hiline_select_x', choices = names(numdata), selected = names(numdata)) updateSelectInput(session, 'hiline_select_y', choices = names(numdata), selected = names(numdata)) } else if (ncol(num_data) < 1) { updateSelectInput(session, 'linely_select_x', choices = '', selected = '') updateSelectInput(session, 'linely_select_y', choices = '', selected = '') updateSelectInput(session, 'boline_select_x', choices = '', selected = '') updateSelectInput(session, 'boline_select_y', choices = '', selected = '') updateSelectInput(session, 'hiline_select_x', choices = '', selected = '') updateSelectInput(session, 'hiline_select_y', choices = '', selected = '') } else { updateSelectInput(session, 'linely_select_x', choices = names(num_data), selected = names(num_data)) updateSelectInput(session, 'linely_select_y', choices = names(num_data), selected = names(num_data)) updateSelectInput(session, 'boline_select_x', choices = names(num_data), selected = names(num_data)) updateSelectInput(session, 'boline_select_y', choices = names(num_data), selected = names(num_data)) updateSelectInput(session, 'hiline_select_x', choices = names(num_data), selected = names(num_data)) updateSelectInput(session, 'hiline_select_y', choices = names(num_data), selected = names(num_data)) } }) observeEvent(input$submit_part_train_per, { num_data <- cbind.data.frame(final_split$train[, sapply(final_split$train, is.numeric)], final_split$train[, sapply(final_split$train, is.Date)]) k <- final_split$train %>% map(is.numeric) %>% unlist() t <- final_split$train %>% map(is.Date) %>% unlist() j1 <- names(which(k == TRUE)) j2 <- names(which(t == TRUE)) if (length(j1) == 0) { j <- j2 } else if (length(j2) == 0) { j <- j1 } else { j <- c(j1, j2) } colnames(num_data) <- j if (is.null(dim(num_data))) { numdata <- tibble::as_data_frame(num_data) updateSelectInput(session, 'linely_select_x', choices = names(numdata), selected = names(numdata)) updateSelectInput(session, 'linely_select_y', choices = names(numdata), selected = names(numdata)) updateSelectInput(session, 'boline_select_x', choices = names(numdata), selected = names(numdata)) updateSelectInput(session, 'boline_select_y', choices = names(numdata), selected = names(numdata)) updateSelectInput(session, 'hiline_select_x', choices = names(numdata), selected = names(numdata)) updateSelectInput(session, 'hiline_select_y', choices = names(numdata), selected = names(numdata)) } else if (ncol(num_data) < 1) { updateSelectInput(session, 'linely_select_x', choices = '', selected = '') updateSelectInput(session, 'linely_select_y', choices = '', selected = '') updateSelectInput(session, 'boline_select_x', choices = '', selected = '') updateSelectInput(session, 'boline_select_y', choices = '', selected = '') updateSelectInput(session, 'hiline_select_x', choices = '', selected = '') updateSelectInput(session, 'hiline_select_y', choices = '', selected = '') } else { updateSelectInput(session, 'linely_select_x', choices = names(num_data), selected = names(num_data)) updateSelectInput(session, 'linely_select_y', choices = names(num_data), selected = names(num_data)) updateSelectInput(session, 'boline_select_x', choices = names(num_data), selected = names(num_data)) updateSelectInput(session, 'boline_select_y', choices = names(num_data), selected = names(num_data)) updateSelectInput(session, 'hiline_select_x', choices = names(num_data), selected = names(num_data)) updateSelectInput(session, 'hiline_select_y', choices = names(num_data), selected = names(num_data)) } }) output$linely_plot_1 <- plotly::renderPlotly({ linely(data = final_split$train, x = input$linely_select_x, y = input$linely_select_y, title = input$linely_title, x_title = input$linely_xlabel, y_title = input$linely_ylabel, lcol = input$linely_color, lwidth = input$linely_width, ltype = input$linely_type) }) output$boline_plot_1 <- rbokeh::renderRbokeh({ boline(data = final_split$train, x_data = input$boline_select_x, fig_title = input$boline_title, x_lab = input$boline_xlabel, y_lab = input$boline_ylabel, y_data = input$boline_select_y, l_color = input$boline_color, l_type = input$boline_type, l_width = input$boline_width, l_alpha = input$boline_alpha) }) output$hiline_plot_1 <- highcharter::renderHighchart({ highline(data = final_split$train, x = input$hiline_select_x, columns = input$hiline_select_y, add_labels = input$hiline_labels) })
/scratch/gouwar.j/cran-all/cranData/xplorerr/inst/app-visualize/logic/logic_line_prh.R
source("helper/pie-plot.R") # update variable selection for bar plots observe({ updateSelectInput(session, 'pie_select', choices = names(data())) updateSelectInput(session, 'pie_label', choices = names(data())) }) observeEvent(input$finalok, { f_data <- final_split$train[, sapply(final_split$train, is.factor)] num_data <- final_split$train[, sapply(final_split$train, is.numeric)] if (is.null(dim(f_data))) { k <- final_split$train %>% map(is.factor) %>% unlist() j <- names(which(k == TRUE)) fdata <- tibble::as_data_frame(f_data) colnames(fdata) <- j updateSelectInput(session, inputId = "pie_select", choices = names(fdata)) updateSelectInput(session, inputId = "pie_label", choices = names(fdata)) } else { updateSelectInput(session, 'pie_select', choices = names(f_data)) updateSelectInput(session, 'pie_label', choices = names(f_data)) } }) observeEvent(input$submit_part_train_per, { f_data <- final_split$train[, sapply(final_split$train, is.factor)] num_data <- final_split$train[, sapply(final_split$train, is.numeric)] if (is.null(dim(f_data))) { k <- final_split$train %>% map(is.factor) %>% unlist() j <- names(which(k == TRUE)) fdata <- tibble::as_data_frame(f_data) colnames(fdata) <- j updateSelectInput(session, inputId = "pie_select", choices = names(fdata)) updateSelectInput(session, inputId = "pie_label", choices = names(fdata)) } else { updateSelectInput(session, 'pie_select', choices = names(f_data)) updateSelectInput(session, 'pie_label', choices = names(f_data)) } }) # selected data pie_data <- reactive({ req(input$pie_select) out <- table(final_split$train[, input$pie_select]) }) pie_labels <- reactive({ out <- final_split$train[, input$pie_label] labs <- levels(out) }) # dynamic UI for bar colors output$ui_ncolpie <- renderUI({ ncol <- as.integer(input$ncolpie) if (ncol < 1) { NULL } else { lapply(1:ncol, function(i) { textInput(paste("n_piecol_", i), label = paste0("Color ", i), value = 'blue') }) } }) colours_pie <- reactive({ ncol <- as.integer(input$ncolpie) if (ncol < 1) { colors <- NULL } else { collect <- list(lapply(1:ncol, function(i) { input[[paste("n_piecol_", i)]] })) colors <- unlist(collect) } colors }) output$pie_1 <- renderPlot({ pie_plot(pie_data(), clock = input$pie_clock, rad = input$pie_radius, initangle = input$pie_angle, lab = pie_labels(), edg = input$pie_edges ) }) output$pie_2 <- renderPlot({ if (is.null(colours_pie())) { pie_plot(pie_data(), clock = input$pie_clock, rad = input$pie_radius, initangle = input$pie_angle, lab = pie_labels(), edg = input$pie_edges, bord = input$pie_border, ltype = input$pie_lty, den = input$pie_density, ang = input$pie_dangle, colors = colours_pie() ) } else { pie_plot(pie_data(), clock = input$pie_clock, rad = input$pie_radius, initangle = input$pie_angle, lab = pie_labels(), edg = input$pie_edges, bord = input$pie_border, ltype = input$pie_lty, den = NULL, ang = input$pie_dangle, colors = colours_pie() ) } }) output$pie_3 <- renderPlot({ if (is.null(colours_pie())) { pie_plot(pie_data(), clock = input$pie_clock, rad = input$pie_radius, initangle = input$pie_angle, lab = pie_labels(), edg = input$pie_edges, bord = input$pie_border, ltype = input$pie_lty, den = input$pie_density, ang = input$pie_dangle, colors = colours_pie(), title = input$pie_title, colmain = input$pie_titlecol, fontmain = input$pie_font, cexmain = input$pie_cex ) } else { pie_plot(pie_data(), clock = input$pie_clock, rad = input$pie_radius, initangle = input$pie_angle, lab = pie_labels(), edg = input$pie_edges, bord = input$pie_border, ltype = input$pie_lty, den = NULL, ang = input$pie_dangle, colors = colours_pie(), title = input$pie_title, colmain = input$pie_titlecol, fontmain = input$pie_font, cexmain = input$pie_cex ) } }) output$pie_final <- renderPlot({ if (is.null(colours_pie())) { pie_plot(pie_data(), clock = input$pie_clock, rad = input$pie_radius, initangle = input$pie_angle, lab = pie_labels(), edg = input$pie_edges, bord = input$pie_border, ltype = input$pie_lty, den = input$pie_density, ang = input$pie_dangle, colors = colours_pie(), title = input$pie_title, colmain = input$pie_titlecol, fontmain = input$pie_font, cexmain = input$pie_cex ) } else { pie_plot(pie_data(), clock = input$pie_clock, rad = input$pie_radius, initangle = input$pie_angle, lab = pie_labels(), edg = input$pie_edges, bord = input$pie_border, ltype = input$pie_lty, den = NULL, ang = input$pie_dangle, colors = colours_pie(), title = input$pie_title, colmain = input$pie_titlecol, fontmain = input$pie_font, cexmain = input$pie_cex ) } }) # plot download output$ubar_downloadGraph <- downloadHandler( filename <- function() { paste(input$ubar_fileName, ".png") }, content <- function(file) { png(file) plot <- bar_plotb( counts(), input$ubar_horiz, input$ubar_beside, input$ubar_barspace, input$ubar_title, input$ubar_subtitle, input$ubar_xlabel, input$ubar_ylabel, input$ubar_coltitle, input$ubar_colsub, input$ubar_colaxis, input$ubar_collabel, input$ubar_fontmain, input$ubar_fontsub, input$ubar_fontaxis, input$ubar_fontlab, input$ubar_cexmain, input$ubar_cexsub, input$ubar_cexaxis, input$ubar_cexlab, input$ubar_plottext, input$ubar_text_x_loc, input$ubar_text_y_loc, input$ubar_textcolor, input$ubar_textfont, input$ubar_textsize, input$ubar_mtextplot, input$ubar_mtext_side, input$ubar_mtext_line, input$ubar_mtextadj, input$ubar_mtextcolor, input$ubar_mtextfont, input$ubar_mtextsize ) print(plot) dev.off() } )
/scratch/gouwar.j/cran-all/cranData/xplorerr/inst/app-visualize/logic/logic_pie.R
source("helper/pie3d-plot.R") # update variable selection for bar plots observe({ updateSelectInput(session, 'pie3_select', choices = names(data())) updateSelectInput(session, 'pie3_label', choices = names(data())) }) observeEvent(input$finalok, { f_data <- final_split$train[, sapply(final_split$train, is.factor)] num_data <- final_split$train[, sapply(final_split$train, is.numeric)] if (is.null(dim(f_data))) { k <- final_split$train %>% map(is.factor) %>% unlist() j <- names(which(k == TRUE)) fdata <- tibble::as_data_frame(f_data) colnames(fdata) <- j updateSelectInput(session, inputId = "pie3_select", choices = names(fdata)) updateSelectInput(session, inputId = "pie3_label", choices = names(fdata)) } else { updateSelectInput(session, 'pie3_select', choices = names(f_data)) updateSelectInput(session, 'pie3_label', choices = names(f_data)) } }) observeEvent(input$submit_part_train_per, { f_data <- final_split$train[, sapply(final_split$train, is.factor)] num_data <- final_split$train[, sapply(final_split$train, is.numeric)] if (is.null(dim(f_data))) { k <- final_split$train %>% map(is.factor) %>% unlist() j <- names(which(k == TRUE)) fdata <- tibble::as_data_frame(f_data) colnames(fdata) <- j updateSelectInput(session, inputId = "pie3_select", choices = names(fdata)) updateSelectInput(session, inputId = "pie3_label", choices = names(fdata)) } else { updateSelectInput(session, 'pie3_select', choices = names(f_data)) updateSelectInput(session, 'pie3_label', choices = names(f_data)) } }) # selected data pie3_data <- reactive({ req(input$pie3_select) out <- table(final_split$train[, input$pie3_select]) }) pie3_labels <- reactive({ out <- final_split$train[, input$pie3_label] labs <- levels(out) }) # dynamic UI for bar colors output$ui_ncolpie3 <- renderUI({ ncol <- as.integer(input$ncolpie3) if (ncol < 1) { NULL } else { lapply(1:ncol, function(i) { textInput(paste("n_pie3col_", i), label = paste0("Color ", i), value = 'blue') }) } }) colours_pie3 <- reactive({ ncol <- as.integer(input$ncolpie3) if (ncol < 1) { colors <- NULL } else { collect <- list(lapply(1:ncol, function(i) { input[[paste("n_pie3col_", i)]] })) colors <- unlist(collect) } colors }) # dynamic UI for label positions output$ui_nlabpospie3 <- renderUI({ ncol <- as.integer(input$nlabpospie3) if (ncol < 1) { NULL } else { lapply(1:ncol, function(i) { textInput(paste("n_pie3labpos_", i), label = paste0("n_labpos_pie3", i)) }) } }) labpos_pie3 <- reactive({ ncol <- as.integer(input$nlabpospie3) if (ncol < 1) { colors <- NULL } else { collect <- list(lapply(1:ncol, function(i) { input[[paste("n_pie3labpos_", i)]] })) colors <- unlist(collect) } colors }) output$pie3_1 <- renderPlot({ pie3_plot(pie3_data(), rad = input$pie3_radius, lab = pie3_labels(), high = input$pie3_height ) }) output$pie3_2 <- renderPlot({ pie3_plot(pie3_data(), rad = input$pie3_radius, lab = pie3_labels(), high = input$pie3_height, bord = input$pie3_border, begin = input$pie3_start, explo = input$pie3_explode, shd = input$pie3_shade, edg = input$pie3_edges ) }) output$pie3_3 <- renderPlot({ pie3_plot(pie3_data(), rad = input$pie3_radius, lab = pie3_labels(), high = input$pie3_height, bord = input$pie3_border, begin = input$pie3_start, explo = input$pie3_explode, shd = input$pie3_shade, edg = input$pie3_edges, colors = colours_pie3() ) }) output$pie3_4 <- renderPlot({ pie3_plot(pie3_data(), rad = input$pie3_radius, lab = pie3_labels(), high = input$pie3_height, bord = input$pie3_border, begin = input$pie3_start, explo = input$pie3_explode, shd = input$pie3_shade, edg = input$pie3_edges, colors = colours_pie3(), labcol = input$pie3_labcol, labcex = input$pie3_labcex, labrad = input$pie3_labrad ) }) output$pie3_5 <- renderPlot({ pie3_plot(pie3_data(), rad = input$pie3_radius, lab = pie3_labels(), high = input$pie3_height, bord = input$pie3_border, begin = input$pie3_start, explo = input$pie3_explode, shd = input$pie3_shade, edg = input$pie3_edges, colors = colours_pie3(), labcol = input$pie3_labcol, labcex = input$pie3_labcex, labrad = input$pie3_labrad, title = input$pie3_title, colmain = input$pie3_titlecol, fontmain = input$pie3_font, cexmain = input$pie3_cex ) }) output$pie3_final <- renderPlot({ pie3_plot(pie3_data(), rad = input$pie3_radius, lab = pie3_labels(), high = input$pie3_height, bord = input$pie3_border, begin = input$pie3_start, explo = input$pie3_explode, shd = input$pie3_shade, edg = input$pie3_edges, colors = colours_pie3(), labcol = input$pie3_labcol, labcex = input$pie3_labcex, labrad = input$pie3_labrad, title = input$pie3_title, colmain = input$pie3_titlecol, fontmain = input$pie3_font, cexmain = input$pie3_cex ) }) # plot download output$ubar_downloadGraph <- downloadHandler( filename <- function() { paste(input$ubar_fileName, ".png") }, content <- function(file) { png(file) plot <- bar_plotb( counts(), input$ubar_horiz, input$ubar_beside, input$ubar_barspace, input$ubar_title, input$ubar_subtitle, input$ubar_xlabel, input$ubar_ylabel, input$ubar_coltitle, input$ubar_colsub, input$ubar_colaxis, input$ubar_collabel, input$ubar_fontmain, input$ubar_fontsub, input$ubar_fontaxis, input$ubar_fontlab, input$ubar_cexmain, input$ubar_cexsub, input$ubar_cexaxis, input$ubar_cexlab, input$ubar_plottext, input$ubar_text_x_loc, input$ubar_text_y_loc, input$ubar_textcolor, input$ubar_textfont, input$ubar_textsize, input$ubar_mtextplot, input$ubar_mtext_side, input$ubar_mtext_line, input$ubar_mtextadj, input$ubar_mtextcolor, input$ubar_mtextfont, input$ubar_mtextsize ) print(plot) dev.off() } )
/scratch/gouwar.j/cran-all/cranData/xplorerr/inst/app-visualize/logic/logic_pie3d.R
source('helper/piely.R') source('helper/highpie.R') observeEvent(input$finalok, { f_data <- final_split$train[, sapply(final_split$train, is.factor)] # validate(need(!dim(f_data)[2] == 0, 'No factor variables in the data.')) if (is.null(dim(f_data))) { k <- final_split$train %>% map(is.factor) %>% unlist() j <- names(which(k == TRUE)) fdata <- tibble::as_data_frame(f_data) colnames(fdata) <- j updateSelectInput(session, 'piely_select_x', choices = names(fdata), selected = names(fdata)) updateSelectInput(session, 'hipie_select_x', choices = names(fdata), selected = names(fdata)) } else if (dim(f_data)[2] == 0) { updateSelectInput(session, 'piely_select_x', choices = '', selected = '') updateSelectInput(session, 'hipie_select_x', choices = '', selected = '') } else { updateSelectInput(session, 'piely_select_x', choices = names(f_data)) updateSelectInput(session, 'hipie_select_x', choices = names(f_data)) } }) observeEvent(input$submit_part_train_per, { f_data <- final_split$train[, sapply(final_split$train, is.factor)] # validate(need(!dim(f_data)[2] == 0, 'No factor variables in the data.')) if (is.null(dim(f_data))) { k <- final_split$train %>% map(is.factor) %>% unlist() j <- names(which(k == TRUE)) fdata <- tibble::as_data_frame(f_data) colnames(fdata) <- j updateSelectInput(session, 'piely_select_x', choices = names(fdata), selected = names(fdata)) updateSelectInput(session, 'hipie_select_x', choices = names(fdata), selected = names(fdata)) } else if (dim(f_data)[2] == 0) { updateSelectInput(session, 'piely_select_x', choices = '', selected = '') updateSelectInput(session, 'hipie_select_x', choices = '', selected = '') } else { updateSelectInput(session, 'piely_select_x', choices = names(f_data)) updateSelectInput(session, 'hipie_select_x', choices = names(f_data)) } }) output$piely_plot_1 <- plotly::renderPlotly({ piely(data = final_split$train, x = input$piely_select_x, title = input$piely_title, x_title = input$piely_xlabel, y_title = input$piely_ylabel, text_pos = input$piely_text_pos, text_info = input$piely_text_info, text_direction = input$piely_text_dir, text_rotation = input$piely_text_rotation, pie_pull = input$piely_pull, pie_hole = input$piely_hole, col_opacity = input$piely_opacity, pie_l_col = input$piely_color) }) output$hipie_plot_1 <- highcharter::renderHighchart({ highpie(data = final_split$train, column = input$hipie_select_x) })
/scratch/gouwar.j/cran-all/cranData/xplorerr/inst/app-visualize/logic/logic_pie_prh.R
source("helper/scatter-plot.R") # observe({ # updateSelectInput(session, 'scatter_select_x', choices = names(data())) # updateSelectInput(session, 'scatter_select_y', choices = names(data())) # }) observeEvent(input$finalok, { num_data <- final_split$train[, sapply(final_split$train, is.numeric)] if (is.null(dim(num_data))) { k <- final_split$train %>% map(is.numeric) %>% unlist() j <- names(which(k == TRUE)) numdata <- tibble::as_data_frame(num_data) colnames(numdata) <- j updateSelectInput(session, 'scatter_select_x', choices = names(numdata), selected = names(numdata)) updateSelectInput(session, 'scatter_select_y', choices = names(numdata), selected = names(numdata)) } else if (ncol(num_data) < 1) { updateSelectInput(session, 'scatter_select_x', choices = '', selected = '') updateSelectInput(session, 'scatter_select_y', choices = '', selected = '') } else { updateSelectInput(session, 'scatter_select_x', choices = names(num_data)) updateSelectInput(session, 'scatter_select_y', choices = names(num_data)) } }) observeEvent(input$submit_part_train_per, { num_data <- final_split$train[, sapply(final_split$train, is.numeric)] if (is.null(dim(num_data))) { k <- final_split$train %>% map(is.numeric) %>% unlist() j <- names(which(k == TRUE)) numdata <- tibble::as_data_frame(num_data) colnames(numdata) <- j updateSelectInput(session, 'scatter_select_x', choices = names(numdata), selected = names(numdata)) updateSelectInput(session, 'scatter_select_y', choices = names(numdata), selected = names(numdata)) } else if (ncol(num_data) < 1) { updateSelectInput(session, 'scatter_select_x', choices = '', selected = '') updateSelectInput(session, 'scatter_select_y', choices = '', selected = '') } else { updateSelectInput(session, 'scatter_select_x', choices = names(num_data)) updateSelectInput(session, 'scatter_select_y', choices = names(num_data)) } }) # selected data selected_x <- reactive({ req(input$scatter_select_x) out <- final_split$train[, input$scatter_select_x] }) selected_y <- reactive({ req(input$scatter_select_y) out <- final_split$train[, input$scatter_select_y] }) output$ui_xrange_min <- renderUI({ df <- final_split$train if (is.null(df)) return(NULL) numericInput('x_range_min', 'X Axis Min', value = min(as.numeric(selected_x()))) }) output$ui_xrange_max <- renderUI({ df <- final_split$train if (is.null(df)) return(NULL) numericInput('x_range_max', 'X Axis Max', value = max(as.numeric(selected_x()))) }) output$ui_yrange_min <- renderUI({ df <- final_split$train if (is.null(df)) return(NULL) numericInput('y_range_min', 'Y Axis Min', value = min(as.numeric(selected_y()))) }) output$ui_yrange_max <- renderUI({ df <- final_split$train if (is.null(df)) return(NULL) numericInput('y_range_max', 'Y Axis Max', value = max(as.numeric(selected_y()))) }) output$scatter_plot_1 <- renderPlot({ scatter_plot(selected_x(), selected_y(), input$scatter_title, input$scatter_subtitle, input$scatter_xlabel, input$scatter_ylabel, input$scatter_colors, input$scatter_fill, input$scatter_shape, size = input$scatter_size1) }) output$scatter_plot_2 <- renderPlot({ scatter_plot(selected_x(), selected_y(), input$scatter_title, input$scatter_subtitle, input$scatter_xlabel, input$scatter_ylabel, input$scatter_colors, input$scatter_fill, input$scatter_shape, input$x_range_min, input$x_range_max, input$y_range_min, input$y_range_max, input$scatter_size1) }) output$scatter_plot_3 <- renderPlot({ scatter_plot(selected_x(), selected_y(), input$scatter_title, input$scatter_subtitle, input$scatter_xlabel, input$scatter_ylabel, input$scatter_colors, input$scatter_fill, input$scatter_shape, input$x_range_min, input$x_range_max, input$y_range_min, input$y_range_max, input$scatter_size1, fitline = input$fitline_y, col_abline = input$col_fitline, lty_abline = input$lty_fitline, lwd_abline = input$lwd_fitline) }) output$scatter_plot_4 <- renderPlot({ scatter_plot( selected_x(), selected_y(), input$scatter_title, input$scatter_subtitle, input$scatter_xlabel, input$scatter_ylabel, input$scatter_colors, input$scatter_fill, input$scatter_shape, input$x_range_min, input$x_range_max, input$y_range_min, input$y_range_max, input$scatter_size1, input$scatter_coltitle, input$scatter_colsub, input$scatter_colaxis, input$scatter_collabel, input$scatter_fontmain, input$scatter_fontsub, input$scatter_fontaxis, input$scatter_fontlab, input$scatter_cexmain, input$scatter_cexsub, input$scatter_cexaxis, input$scatter_cexlab, fitline = input$fitline_y, col_abline = input$col_fitline, lty_abline = input$lty_fitline, lwd_abline = input$lwd_fitline ) }) output$scatter_plot_5 <- renderPlot({ scatter_plot( selected_x(), selected_y(), input$scatter_title, input$scatter_subtitle, input$scatter_xlabel, input$scatter_ylabel, input$scatter_colors, input$scatter_fill, input$scatter_shape, input$x_range_min, input$x_range_max, input$y_range_min, input$y_range_max, input$scatter_size1, input$scatter_coltitle, input$scatter_colsub, input$scatter_colaxis, input$scatter_collabel, input$scatter_fontmain, input$scatter_fontsub, input$scatter_fontaxis, input$scatter_fontlab, input$scatter_cexmain, input$scatter_cexsub, input$scatter_cexaxis, input$scatter_cexlab, input$scatter_plottext, input$scatter_text_x_loc, input$scatter_text_y_loc, input$scatter_textcolor, input$scatter_textfont, input$scatter_textsize, input$scatter_mtextplot, input$scatter_mtext_side, input$scatter_mtext_line, input$scatter_mtextadj, input$scatter_mtextcolor, input$scatter_mtextfont, input$scatter_mtextsize, input$fitline_y, input$col_fitline, input$lty_fitline, input$lwd_fitline ) }) output$scatter_plot_final <- renderPlot({ scatter_plot( selected_x(), selected_y(), input$scatter_title, input$scatter_subtitle, input$scatter_xlabel, input$scatter_ylabel, input$scatter_colors, input$scatter_fill, input$scatter_shape, input$x_range_min, input$x_range_max, input$y_range_min, input$y_range_max, input$scatter_size1, input$scatter_coltitle, input$scatter_colsub, input$scatter_colaxis, input$scatter_collabel, input$scatter_fontmain, input$scatter_fontsub, input$scatter_fontaxis, input$scatter_fontlab, input$scatter_cexmain, input$scatter_cexsub, input$scatter_cexaxis, input$scatter_cexlab, input$scatter_plottext, input$scatter_text_x_loc, input$scatter_text_y_loc, input$scatter_textcolor, input$scatter_textfont, input$scatter_textsize, input$scatter_mtextplot, input$scatter_mtext_side, input$scatter_mtext_line, input$scatter_mtextadj, input$scatter_mtextcolor, input$scatter_mtextfont, input$scatter_mtextsize, input$fitline_y, input$col_fitline, input$lty_fitline, input$lwd_fitline ) })
/scratch/gouwar.j/cran-all/cranData/xplorerr/inst/app-visualize/logic/logic_scatter.R
source('helper/scatterly.R') source('helper/boscatter.R') source('helper/hscatter.R') observeEvent(input$finalok, { num_data <- final_split$train[, sapply(final_split$train, is.numeric)] if (is.null(dim(num_data))) { k <- final_split$train %>% map(is.numeric) %>% unlist() j <- names(which(k == TRUE)) numdata <- tibble::as_data_frame(num_data) colnames(numdata) <- j updateSelectInput(session, 'scatly_select_x', choices = names(numdata), selected = names(numdata)) updateSelectInput(session, 'scatly_select_y', choices = names(numdata), selected = names(numdata)) updateSelectInput(session, 'boscat_select_x', choices = names(numdata), selected = names(numdata)) updateSelectInput(session, 'boscat_select_y', choices = names(numdata), selected = names(numdata)) updateSelectInput(session, 'hiscat_select_x', choices = names(numdata), selected = names(numdata)) updateSelectInput(session, 'hiscat_select_y', choices = names(numdata), selected = names(numdata)) } else if (ncol(num_data) < 1) { updateSelectInput(session, 'scatly_select_x', choices = '', selected = '') updateSelectInput(session, 'scatly_select_y', choices = '', selected = '') updateSelectInput(session, 'boscat_select_x', choices = '', selected = '') updateSelectInput(session, 'boscat_select_y', choices = '', selected = '') updateSelectInput(session, 'hiscat_select_x', choices = '', selected = '') updateSelectInput(session, 'hiscat_select_y', choices = '', selected = '') } else { updateSelectInput(session, 'scatly_select_x', choices = names(num_data)) updateSelectInput(session, 'scatly_select_y', choices = names(num_data)) updateSelectInput(session, 'boscat_select_x', choices = names(num_data)) updateSelectInput(session, 'boscat_select_y', choices = names(num_data)) updateSelectInput(session, 'hiscat_select_x', choices = names(num_data)) updateSelectInput(session, 'hiscat_select_y', choices = names(num_data)) } }) observeEvent(input$submit_part_train_per, { num_data <- final_split$train[, sapply(final_split$train, is.numeric)] if (is.null(dim(num_data))) { k <- final_split$train %>% map(is.numeric) %>% unlist() j <- names(which(k == TRUE)) numdata <- tibble::as_data_frame(num_data) colnames(numdata) <- j updateSelectInput(session, 'scatly_select_x', choices = names(numdata), selected = names(numdata)) updateSelectInput(session, 'scatly_select_y', choices = names(numdata), selected = names(numdata)) updateSelectInput(session, 'boscat_select_x', choices = names(numdata), selected = names(numdata)) updateSelectInput(session, 'boscat_select_y', choices = names(numdata), selected = names(numdata)) updateSelectInput(session, 'hiscat_select_x', choices = names(numdata), selected = names(numdata)) updateSelectInput(session, 'hiscat_select_y', choices = names(numdata), selected = names(numdata)) } else if (ncol(num_data) < 1) { updateSelectInput(session, 'scatly_select_x', choices = '', selected = '') updateSelectInput(session, 'scatly_select_y', choices = '', selected = '') updateSelectInput(session, 'boscat_select_x', choices = '', selected = '') updateSelectInput(session, 'boscat_select_y', choices = '', selected = '') updateSelectInput(session, 'hiscat_select_x', choices = '', selected = '') updateSelectInput(session, 'hiscat_select_y', choices = '', selected = '') } else { updateSelectInput(session, 'scatly_select_x', choices = names(num_data)) updateSelectInput(session, 'scatly_select_y', choices = names(num_data)) updateSelectInput(session, 'boscat_select_x', choices = names(num_data)) updateSelectInput(session, 'boscat_select_y', choices = names(num_data)) updateSelectInput(session, 'hiscat_select_x', choices = names(num_data)) updateSelectInput(session, 'hiscat_select_y', choices = names(num_data)) } }) output$scatly_plot_1 <- plotly::renderPlotly({ scatterly(data = final_split$train, y = input$scatly_select_y, x = input$scatly_select_x, title = input$scatly_title, show_legend = FALSE, x_title = input$scatly_xlabel, y_title = input$scatly_ylabel, text = input$scatly_text, color = input$scatly_color, opacity = input$scatly_opacity, symbol = input$scatly_symbol, size = input$scatly_size, fit_line = input$scatly_fit, line_col = input$scatly_lcol, line_type = input$scatly_ltype, line_width = input$scatly_lsize) }) # fitstat <- eventReactive({ # model <- lm(input$boscat_select_y ~ input$boscat_select_x, data = final_split$train) # return(model$coefficients) # }) # intercept <- reactive({ # fitstat()[[1]] # }) # slope <- reactive({ # fitstat()[[2]] # }) # observe({ # updateNumericInput(session, inputId = "boscat_fint", value = intercept()) # updateNumericInput(session, inputId = "boscat_fslope", value = slope()) # }) output$boscat_plot_1 <- rbokeh::renderRbokeh({ bokatter(data = final_split$train, y_data = input$boscat_select_y, x_data = input$boscat_select_x, fig_title = input$boscat_title, x_lab = input$boscat_xlabel, y_lab = input$boscat_ylabel, x_grid = input$boscat_xgrid, y_grid = input$boscat_ygrid, glyph = input$boscat_shape, point_size = input$boscat_size, inner_col = input$boscat_color, inner_alpha = input$boscat_alpha, add_line = input$boscat_fitline, line_a = input$boscat_fint, line_b = input$boscat_fslope, line_color = input$boscat_lcolor, line_alpha = input$boscat_lalpha, line_width = input$boscat_lwidth, line_type = input$boscat_ltype) }) output$hiscat_plot_1 <- highcharter::renderHighchart({ hscatter(data = final_split$train, x = input$hiscat_select_x, y = input$hiscat_select_y, xax_title = input$hiscat_xlabel, yax_title = input$hiscat_ylabel, point_size = input$hiscat_size, scatter_series_name = ' ', point_col = input$hiscat_color, point_shape = input$hiscat_symbol, fit_line = input$hiscat_fit, line_col = input$hiscat_lcol, line_width = input$hiscat_lsize, point_on_line = FALSE, title = input$hiscat_title, sub = input$hiscat_subtitle) })
/scratch/gouwar.j/cran-all/cranData/xplorerr/inst/app-visualize/logic/logic_scatter_prh.R
# output output$screen <- renderPrint({ ds_screener(filt_data$p) }) observeEvent(input$finalok, { updateNavbarPage(session, 'mainpage', selected = 'tab_viz_home') updateNavlistPanel(session, 'navlist_vizmenu', 'tab_home_viz') }) final_split <- reactiveValues(train = NULL) observeEvent(input$finalok, { final_split$train <- filt_data$p })
/scratch/gouwar.j/cran-all/cranData/xplorerr/inst/app-visualize/logic/logic_screen.R
show_but_sel <- eventReactive(input$button_selvar_yes, { column(12, align = 'center', selectInput( inputId = 'dplyr_selvar', label = '', choices = '', selected = '', multiple = TRUE, selectize = TRUE ) ) }) output$show_sel_button <- renderUI({ show_but_sel() }) sel_sub_but <- eventReactive(input$button_selvar_yes, { column(12, align = 'center', br(), br(), actionButton(inputId = 'submit_dply_selvar', label = 'Submit', width = '120px', icon = icon('check')), bsTooltip("submit_seldata", "Click here to select variables.", "bottom", options = list(container = "body")) ) }) output$sub_sel_button <- renderUI({ sel_sub_but() }) observe({ updateSelectInput( session, inputId = "dplyr_selvar", choices = names(data()), selected = names(data()) ) }) observeEvent(input$button_selvar_yes, { updateSelectInput( session, inputId = "dplyr_selvar", choices = names(final()), selected = names(final()) ) }) final_sel <- reactiveValues(a = NULL) finalsel <- eventReactive(input$submit_dply_selvar, { k <- final() %>% select(input$dplyr_selvar) k }) observeEvent(input$submit_dply_selvar, { final_sel$a <- finalsel() }) observeEvent(input$button_selvar_no, { final_sel$a <- final() }) observeEvent(input$button_selvar_no, { removeUI( selector = "div:has(> #dplyr_selvar)" ) removeUI( selector = "div:has(> #submit_dply_selvar)" ) }) observeEvent(input$button_selvar_no, { updateNavbarPage(session, 'mainpage', selected = 'tab_trans') updateNavlistPanel(session, 'navlist_trans', 'tab_filter') }) observeEvent(input$submit_dply_selvar, { updateNavbarPage(session, 'mainpage', selected = 'tab_trans') updateNavlistPanel(session, 'navlist_trans', 'tab_filter') })
/scratch/gouwar.j/cran-all/cranData/xplorerr/inst/app-visualize/logic/logic_select.R
library(stringr) output$trans_try <- renderUI({ ncol <- as.integer(ncol(uploadata$t)) lapply(1:ncol, function(i) { fluidRow( column(3, selectInput(paste("n_col_", i), label = '', width = '150px', choices = names(uploadata$t)[i], selected = names(uploadata$t)[i]) ), column(3, textInput(paste("new_name_", i), label = '', width = '150px', value = names(uploadata$t)[i]) ), column(3, selectInput(paste0("data_type_", i), label = '', width = '150px', choices = c('numeric', 'factor', 'Date', 'character', 'integer'), selected = class(uploadata$t[[i]])) ), column(3, conditionalPanel(condition = paste(paste0("input.data_type_", i), "== 'Date'"), column(4, br(), tags$h5('Format')), column(8, selectInput(paste("date_type_", i), label = '', width = '150px', choices = c('%d %m %y', '%d %m %Y', '%y %m %d', '%Y %m %d', '%d %y %m', '%d %Y %m', '%m %d %y', '%m %d %Y', '%y %d %m', '%Y %d %m', '%m %y %d', '%m %Y %d', '%d/%m/%y', '%d/%m/%Y', '%y/m /%d', '%Y/%m/%d', '%d/%y/%m', '%d/%Y/%m', '%m/%d/%y', '%m/%d/%Y', '%y/%d/%m', '%Y/%d/%m', '%m/%y/%d', '%m/%Y/%d', '%d-%m-%y', '%d-%m-%Y', '%y-m -%d', '%Y-%m-%d', '%d-%y-%m', '%d-%Y-%m', '%m-%d-%y', '%m-%d-%Y', '%y-%d-%m', '%Y-%d-%m', '%m-%y-%d', '%m-%Y-%d' ), selected = '%Y %m %d') ) ) ) ) }) }) original <- reactive({ uploadata$t }) save_names <- reactive({ names(original()) }) n <- reactive({ length(original()) }) data_types <- reactive({ ncol <- as.integer(ncol(uploadata$t)) collect <- list(lapply(1:ncol, function(i) { input[[paste0("data_type_", i)]] })) colors <- unlist(collect) }) new_names <- reactive({ ncol <- as.integer(ncol(uploadata$t)) collect <- list(lapply(1:ncol, function(i) { input[[paste("new_name_", i)]] })) colors <- unlist(collect) colnames <- str_replace(colors, " ", "_") }) # original <- reactive({ # data() # }) # save_names <- reactive({ # names(original()) # }) # n <- reactive({ # length(original()) # }) # data_types <- reactive({ # ncol <- as.integer(ncol(data())) # collect <- list(lapply(1:ncol, function(i) { # input[[paste0("data_type_", i)]] # })) # colors <- unlist(collect) # }) # new_names <- reactive({ # ncol <- as.integer(ncol(data())) # collect <- list(lapply(1:ncol, function(i) { # input[[paste("new_name_", i)]] # })) # colors <- unlist(collect) # colnames <- str_replace(colors, " ", "_") # }) copy <- eventReactive(input$apply_changes, { out <- list() for (i in seq_len(n())) { if (data_types()[i] == 'Date') { inp <- eval(parse(text = paste0('input$', paste0('date_type_', i)))) out[[i]] <- eval(parse(text = paste0("as.", data_types()[i], "(original()$", save_names()[i], ", ", inp, ")"))) } else { out[[i]] <- eval(parse(text = paste0("as.", data_types()[i], "(original()$", save_names()[i], ")"))) } } names(out) <- new_names() return(out) }) final <- eventReactive(input$apply_changes, { data.frame(copy(), stringsAsFactors = F) }) observeEvent(input$apply_changes, { updateNavbarPage(session, 'mainpage', selected = 'tab_trans') updateNavlistPanel(session, 'navlist_trans', 'tab_selvar') })
/scratch/gouwar.j/cran-all/cranData/xplorerr/inst/app-visualize/logic/logic_transform2.R
# importing data inFile1 <- reactive({ if(is.null(input$file1)) { return(NULL) } else { input$file1 } }) data1 <- reactive({ if(is.null(inFile1())) { return(NULL) } else { read.csv(inFile1()$datapath, header = input$header, sep = input$sep, quote = input$quote) } }) # importing data inFile2 <- reactive({ if(is.null(input$file2)) { return(NULL) } else { input$file2 } }) data2 <- reactive({ if(is.null(inFile2())) { return(NULL) } else { ext <- tools::file_ext(inFile2()$name) file.rename(inFile2()$datapath, paste(inFile2()$datapath, ext, sep=".")) readxl::read_excel( path = paste(inFile2()$datapath, ext, sep="."), sheet = input$sheet_n ) } }) # importing data inFile3 <- reactive({ if(is.null(input$file3)) { return(NULL) } else { input$file3 } }) data3 <- reactive({ if(is.null(inFile3())) { return(NULL) } else { jsonlite::fromJSON(inFile3()$datapath) } }) # importing data inFile4 <- reactive({ if(is.null(input$file4)) { return(NULL) } else { input$file4 } }) data4 <- reactive({ if(is.null(inFile4())) { return(NULL) } else { haven::read_sas(inFile4()$datapath) } }) inFile5 <- reactive({ if(is.null(input$file5)) { return(NULL) } else { input$file5 } }) data5 <- reactive({ if(is.null(inFile5())) { return(NULL) } else { haven::read_sav(inFile5()$datapath) } }) inFile6 <- reactive({ if(is.null(input$file6)) { return(NULL) } else { input$file6 } }) data6 <- reactive({ if(is.null(inFile6())) { return(NULL) } else { haven::read_stata(inFile6()$datapath) } }) inFile7 <- reactive({ if(is.null(input$file7)) { return(NULL) } else { input$file7 } }) data7 <- reactive({ if(is.null(inFile7())) { return(NULL) } else { readRDS(inFile7()$datapath) } }) observe({ updateSelectInput( session, inputId = 'sel_data', label = '', choices = c(input$file1$name, input$file2$name, input$file3$name, input$file4$name, input$file5$name, input$file6$name, input$file7$name), selected = '' ) }) ext_type <- reactive({ ext <- tools::file_ext(input$sel_data) }) # choosing sample data sampdata <- reactiveValues(s = NULL) observeEvent(input$german_data, { data("GermanCredit") sampdata$s <- GermanCredit }) observeEvent(input$iris_data, { sampdata$s <- iris }) observeEvent(input$mtcars_data, { sampdata$s <- descriptr::mtcarz }) observeEvent(input$hsb_data, { sampdata$s <- hsb }) observeEvent(input$mpg_data, { sampdata$s <- mpg }) observeEvent(input$diamonds_data, { sampdata$s <- diamonds }) uploadata <- reactiveValues(t = NULL) observeEvent(input$submit_seldata, { if (ext_type() == 'csv') { uploadata$t <- data1() } else if (ext_type() == 'xls') { uploadata$t <- data2() } else if (ext_type() == 'xlsx') { uploadata$t <- data2() } else if (ext_type() == 'json') { uploadata$t <- data3() } else if (ext_type() == 'sas7bdat') { uploadata$t <- data4() } else if (ext_type() == 'sav') { uploadata$t <- uploadata$t <- data5() } else if (ext_type() == 'dta') { uploadata$t <- data6() } else { uploadata$t <- data7() } }) observeEvent(input$use_sample_data, { uploadata$t <- sampdata$s }) observeEvent(input$use_sample_data, { updateNavbarPage(session, 'mainpage', selected = 'tab_trans') updateNavlistPanel(session, 'navlist_trans', 'tab_transform') }) observeEvent(input$submit_seldata, { updateNavbarPage(session, 'mainpage', selected = 'tab_trans') updateNavlistPanel(session, 'navlist_trans', 'tab_transform') }) observeEvent(input$csv2datasrc, { updateNavbarPage(session, 'mainpage', selected = 'tab_upload') updateNavlistPanel(session, 'navlist_up', 'tab_datasources') }) observeEvent(input$csv2datatrans, { updateNavbarPage(session, 'mainpage', selected = 'tab_trans') updateNavlistPanel(session, 'navlist_trans', 'tab_seldata') }) observeEvent(input$excel2datasrc, { updateNavbarPage(session, 'mainpage', selected = 'tab_upload') updateNavlistPanel(session, 'navlist_up', 'tab_datasources') }) observeEvent(input$excel2datatrans, { updateNavbarPage(session, 'mainpage', selected = 'tab_trans') updateNavlistPanel(session, 'navlist_trans', 'tab_seldata') }) observeEvent(input$json2datasrc, { updateNavbarPage(session, 'mainpage', selected = 'tab_upload') updateNavlistPanel(session, 'navlist_up', 'tab_datasources') }) observeEvent(input$json2datatrans, { updateNavbarPage(session, 'mainpage', selected = 'tab_trans') updateNavlistPanel(session, 'navlist_trans', 'tab_seldata') }) observeEvent(input$stata2datasrc, { updateNavbarPage(session, 'mainpage', selected = 'tab_upload') updateNavlistPanel(session, 'navlist_up', 'tab_datasources') }) observeEvent(input$stata2datatrans, { updateNavbarPage(session, 'mainpage', selected = 'tab_trans') updateNavlistPanel(session, 'navlist_trans', 'tab_seldata') }) observeEvent(input$spss2datasrc, { updateNavbarPage(session, 'mainpage', selected = 'tab_upload') updateNavlistPanel(session, 'navlist_up', 'tab_datasources') }) observeEvent(input$spss2datatrans, { updateNavbarPage(session, 'mainpage', selected = 'tab_trans') updateNavlistPanel(session, 'navlist_trans', 'tab_seldata') }) observeEvent(input$sas2datasrc, { updateNavbarPage(session, 'mainpage', selected = 'tab_upload') updateNavlistPanel(session, 'navlist_up', 'tab_datasources') }) observeEvent(input$sas2datatrans, { updateNavbarPage(session, 'mainpage', selected = 'tab_trans') updateNavlistPanel(session, 'navlist_trans', 'tab_seldata') }) observeEvent(input$rds2datasrc, { updateNavbarPage(session, 'mainpage', selected = 'tab_upload') updateNavlistPanel(session, 'navlist_up', 'tab_datasources') }) observeEvent(input$rds2datatrans, { updateNavbarPage(session, 'mainpage', selected = 'tab_trans') updateNavlistPanel(session, 'navlist_trans', 'tab_seldata') }) observeEvent(input$welcomebutton, { updateNavbarPage(session, 'mainpage', selected = 'tab_upload') })
/scratch/gouwar.j/cran-all/cranData/xplorerr/inst/app-visualize/logic/logic_upload.R
output$table <- renderDataTable({ final_split$train }) observeEvent(input$view2getdata, { updateNavbarPage(session, 'mainpage', selected = 'tab_upload') updateNavlistPanel(session, 'navlist_up', 'tab_datasources') }) observeEvent(input$view2analyze, { updateNavbarPage(session, 'mainpage', selected = 'tab_eda') updateNavlistPanel(session, 'navlist_eda', 'tab_summary') })
/scratch/gouwar.j/cran-all/cranData/xplorerr/inst/app-visualize/logic/logic_view.R
bar_libopt <- eventReactive(input$click_bar, { fluidRow( fluidRow( column(1), column(2, align = 'center', h5("Base R") ), column(2, align = 'center', h5("rbokeh") ), column(2, align = 'center', h5("plotly") ), column(2, align = 'center', h5("highcharts") ), column(2, align = 'center', h5("ggplot2") ), column(1) ), fluidRow( column(1), column(2, align = 'center', hr() ), column(2, align = 'center', hr() ), column(2, align = 'center', hr() ), column(2, align = 'center', hr() ), column(2, align = 'center', hr() ), column(1) ), fluidRow( column(1), column(2, align = 'center', img(src = 'Rlogonew.png', width = '100px', height = '100px') ), column(2, align = 'center', img(src = 'bokeh_logo.png', width = '100px', height = '100px') ), column(2, align = 'center', img(src = 'plotly_logo.png', width = '100px', height = '100px') ), column(2, align = 'center', img(src = 'highcharts_logo.png', width = '100px', height = '100px') ), column(2, align = 'center', img(src = 'ggplot2_logo.png', width = '100px', height = '100px') ), column(1) ), fluidRow( column(1), column(2, align = 'center', hr() ), column(2, align = 'center', hr() ), column(2, align = 'center', hr() ), column(2, align = 'center', hr() ), column(2, align = 'center', hr() ), column(1) ) ) }) output$vizlib_bar <- renderUI({ bar_libopt() }) observeEvent(input$click_bar, { updateNavbarPage(session, 'mainpage', selected = 'tab_viz_lib') })
/scratch/gouwar.j/cran-all/cranData/xplorerr/inst/app-visualize/logic/logic_vizlib.R
library(shiny) library(ggplot2) library(plotly) library(rbokeh) library(highcharter) library(dplyr) library(purrr) library(tidyr) library(tibble) library(readxl) library(readr) library(jsonlite) library(magrittr) library(tools) library(lubridate) library(scales) library(stringr) shinyServer(function(input, output, session) { source("logic/logic_dataoptions.R", local = T) source("logic/logic_upload.R", local = T) source("logic/logic_transform2.R", local = T) source("logic/logic_select.R", local = T) source("logic/logic_filter.R", local = T) source("logic/logic_screen.R", local = T) source("logic/logic_view.R", local = T) source("logic/logic_bar.R", local = T) source("logic/logic_bar2.R", local = T) source("logic/logic_box.R", local = T) source("logic/logic_box2.R", local = T) source("logic/logic_hist.R", local = T) source("logic/logic_line.R", local = T) source("logic/logic_pie.R", local = T) source("logic/logic_pie3d.R", local = T) source("logic/logic_scatter.R", local = T) source("logic/logic_gscatter.R", local = T) source("logic/logic_home.R", local = T) source("logic/logic_vizlib.R", local = T) source("logic/logic_gbar.R", local = T) source("logic/logic_gbar2.R", local = T) source("logic/logic_gbox.R", local = T) source("logic/logic_gbox2.R", local = T) source("logic/logic_ghist.R", local = T) source("logic/logic_gpie.R", local = T) source("logic/logic_gline.R", local = T) source("logic/logic_gline2.R", local = T) source("logic/logic_bar_plot_1.R", local = T) source("logic/logic_bar_plot_2.R", local = T) source("logic/logic_box_plot_1.R", local = T) source("logic/logic_box_plot_2.R", local = T) source("logic/logic_scatter_prh.R", local = T) source("logic/logic_line_prh.R", local = T) source("logic/logic_hist_prh.R", local = T) source("logic/logic_pie_prh.R", local = T) source("logic/logic_exit_button.R", local = T) })
/scratch/gouwar.j/cran-all/cranData/xplorerr/inst/app-visualize/server.R
tabPanel('Bar Plot', value = 'tab_bar', fluidPage( fluidRow( column(12, align = 'left', h4('Bar Plot') ) ), hr(), fluidRow( column(12, tabsetPanel(type = "tabs", # variables and title tabPanel("Variables", column(6, # column one begins here column(6, align = 'center', br(), br(), # select variable selectInput('ubar_select', 'Select Variable: ', width = '150px', choices = "", selected = "" ), # plot title textInput(inputId = "ubar_title", label = "Title", value = "", width = '150px'), # X axes label textInput(inputId = "ubar_xlabel", label = "X Axes Label", value = "", width = '150px'), tags$br(), # # file name for download # textInput(inputId = "ubar_fileName", label = "Plot Name (Download)", value = "", width = '120px',), # # plot download button # downloadButton("ubar_downloadGraph", "Download"), tags$br() ), # column one ends here # column two begins here column(6, align = 'center', br(), br(), # horizontal selectInput('ubar_horiz', 'Horizontal', choices = c("TRUE" = TRUE, "FALSE" = FALSE), selected = "FALSE", width = '150px' ), # bar space numericInput('ubar_barspace', 'Bar Space: ', width = '150px', value = 1, min = 0.1, step = 0.1 ), # Y axes label textInput(inputId = "ubar_ylabel", label = "Y Axes Label", value = "", width = '150px') ) ), column(6, plotOutput('ubar_plot_1', height = '400px') ) ), # color, width, sharing and axis options tabPanel("Bar Options", column(6, tabsetPanel(type = 'tabs', tabPanel('Bar Width', column(4, numericInput("nbarwidth", "Number of Bars", value = 1, min = 0)), column(4, uiOutput("ui_nbarwidth")) ), tabPanel('Border Color', column(4, numericInput("nborbar", "Number of Border Colors", value = 0, min = 0)), column(4, uiOutput("ui_nborbar")) ), tabPanel('Bar Label', column(6, numericInput("nbarlabel", "Number of Labels", value = 0, min = 0)), column(6, uiOutput("ui_nbarlabel")) ), tabPanel('Bar Color', column(4, numericInput("ncolbar", "Number of Colors", value = 0, min = 0)), column(4, uiOutput("ui_ncolbar")) ) ) ), column(6, plotOutput('ubar_plot_2', height = '400px') ) ), # legend options tabPanel("Axis", column(6, tabsetPanel(type = 'tabs', tabPanel('Axes', column(4, selectInput('ubar_axes', 'Axes', choices = c("TRUE" = TRUE, "FALSE" = FALSE), selected = "TRUE"), numericInput('ubar_axislty', 'Line Type: ', value = 0, min = 0), numericInput('ubar_offset', 'Offset: ', value = 0, min = 0) ) ) ) ), column(6, plotOutput('ubar_plot_3', height = '400px') ) ), # legend options tabPanel("Legend", column(6, tabsetPanel(type = 'tabs', tabPanel('General', br(), flowLayout( selectInput('leg_yn', 'Create Legend', choices = c("TRUE" = TRUE, "FALSE" = FALSE), selected = "FALSE") ), br(), h4('Axis Position', align = 'left', style = 'color:black'), flowLayout( numericInput('leg_x', 'X Axis:', value = 1), numericInput('leg_y', 'Y Axis:', value = 1) ), br(), h4('Legend Names', align = 'left', style = 'color:black'), flowLayout( numericInput('leg_names', 'Select:', value = 1, min = 1, step = 1), uiOutput('ui_legnames') ), br(), h4('Points', align = 'left', style = 'color:black'), flowLayout( numericInput('leg_point', 'Select:', value = 1, min = 0, max = 25, step = 1), uiOutput('ui_legpoint') ) ), tabPanel('Legend Box', flowLayout( selectInput('leg_boxtype', 'Box Type', choices = c('o', 'n'), selected = 'o'), textInput('leg_boxcol', 'Box Color', value = 'white'), numericInput('leg_boxlty', 'Box Border Line', value = 1, min = 1, max = 6, step = 1), numericInput('leg_boxlwd', 'Box Border Width', value = 1, min = 0, step = 0.1), textInput('leg_boxborcol', 'Box Border Color', value = 'black'), numericInput('leg_boxxjust', 'Horizontal Justification', value = 0, min = 0, max = 1), numericInput('leg_boxyjust', 'Vertical Justification', value = 1, min = 0, max = 1) ) ), tabPanel('Legend Text', flowLayout( selectInput('leg_texthoriz', 'Horizontal Text', choices = c(TRUE, FALSE), selected = FALSE), textInput('leg_textcol', 'Text Color', value = 'black'), textInput('leg_title', 'Title', value = ''), numericInput('leg_textfont', 'Text Font', value = 1, min = 1, max = 5, step = 1), numericInput('leg_textcolumns', 'Columns', value = 1, min = 0, step = 1), textInput('leg_titlecol', 'Title Color', value = 'black'), numericInput('leg_textadj', 'Text Horizontal Adj', value = 0.5, min = 0, max = 1, step = 0.1) ) ) ) ), column(6, plotOutput('ubar_plot_4', height = '400px') ) ), # graphical parameters tabPanel("Others", column(6, tabsetPanel(type = 'tabs', tabPanel('Color', flowLayout( textInput('ubar_colaxis', 'Axis Color: ', 'black'), textInput('ubar_coltitle', 'Title Color: ', 'black'), textInput('ubar_collabel', 'Label Color: ', 'black'), textInput('ubar_colsub', 'Subtitle Color: ', 'black') ) ), tabPanel('Size', flowLayout( numericInput('ubar_cexmain', 'Title Size: ', value = 1, min = 0.1, step = 0.1 ), numericInput('ubar_cexsub', 'Subtitle Size: ', value = 1, min = 0.1, step = 0.1 ), numericInput('ubar_cexaxis', 'Axis Size: ', value = 1, min = 0.1, step = 0.1 ), numericInput('ubar_cexlab', 'Label Size: ', value = 1, min = 0.1, step = 0.1 ) ) ), tabPanel('Font', flowLayout( numericInput('ubar_fontmain', 'Title Font', value = 1, min = 1, max = 5, step = 1 ), numericInput('ubar_fontsub', 'Subtitle Font', value = 1, min = 1, max = 5, step = 1 ), numericInput('ubar_fontaxis', 'Axis Font', value = 1, min = 1, max = 5, step = 1 ), numericInput('ubar_fontlab', 'Label Font', value = 1, min = 1, max = 5, step = 1 ) ) ), tabPanel('Text', flowLayout( numericInput( inputId = "ubar_text_x_loc", label = "X Intercept: ", value = 1, step = 1 ), numericInput( inputId = "ubar_text_y_loc", label = "Y Intercept: ", value = 1, step = 1 ), textInput(inputId = "ubar_plottext", label = "Text:", value = ""), numericInput( inputId = "ubar_textfont", label = "Text Font: ", value = 1, min = 1, max = 5, step = 1 ), textInput( inputId = "ubar_textcolor", label = "Text Color: ", value = "black" ), numericInput( inputId = "ubar_textsize", label = "Text Size: ", value = 1, min = 0.1, step = 0.1 ) ) ), tabPanel('Marginal Text', flowLayout( textInput(inputId = "ubar_mtextplot", label = "Text:", value = ""), numericInput( inputId = "ubar_mtext_side", label = "Side: ", value = 1, min = 1, max = 4, step = 1 ), numericInput( inputId = "ubar_mtext_line", label = "Line: ", value = 1, step = 1 ), numericInput( inputId = "ubar_mtextadj", label = "Adj: ", value = 0.5, min = 0, max = 1, step = 0.1 ), numericInput( inputId = "ubar_mtextfont", label = "Text Font: ", value = 1, min = 1, max = 5, step = 1 ), textInput( inputId = "ubar_mtextcolor", label = "Text Color: ", value = "black" ), numericInput( inputId = "ubar_mtextsize", label = "Text Size: ", value = 1, min = 0.1, step = 0.1 ) ) ) ) ), column(6, plotOutput('ubar_plot_5', height = '400px') ) ), # plot tabPanel("Plot", fluidRow( column(8, offset = 2, plotOutput('ubar_plot_final', height = '500px') ) ) ) ) ) ) ) )
/scratch/gouwar.j/cran-all/cranData/xplorerr/inst/app-visualize/ui/ui_bar.R
tabPanel('2 Factor Bar Plot', value = 'tab_bar2', fluidPage( fluidRow( column(12, align = 'left', h4('2 Factor Bar Plot') ) ), hr(), fluidRow( column(12, tabsetPanel(type = "tabs", tabPanel('Variables', # user interface column(6, column(6, # select variable selectInput('bar2_select_x', 'Variable 1: ', choices = "", selected = "" ), # horizontal selectInput('bar2_horiz', 'Horizontal', choices = c("TRUE" = TRUE, "FALSE" = FALSE), selected = "FALSE" ), # X axes label textInput(inputId = "bar2_xlabel", label = "X Axes Label", value = ""), # plot title textInput(inputId = "bar2_title", label = "Title", value = "") ), column(6, # select variable selectInput('bar2_select_y', 'Variable 2: ', choices = "", selected = "" ), # select variable selectInput('bar2_beside', 'Grouped', choices = c("TRUE" = TRUE, "FALSE" = FALSE), selected = "TRUE" ), # Y axes label textInput(inputId = "bar2_ylabel", label = "Y Axes Label", value = "") ) ), # plot column(6, plotOutput('bbar_plot_1') ) ), tabPanel("Bar Options", column(6, tabsetPanel(type = 'tabs', tabPanel('Bar Width', column(4, numericInput("nbarwidth2", "Number of Bars", value = 1, min = 0)), column(4, uiOutput("ui_nbarwidth2")) ), tabPanel('Border Color', column(4, numericInput("nborbar2", "Number of Border Colors", value = 0, min = 0)), column(4, uiOutput("ui_nborbar2")) ), tabPanel('Bar Label', column(4, numericInput("nbarlabel2", "Number of Labels", value = 0, min = 0)), column(6, uiOutput("ui_nbarlabel2")) ), tabPanel('Bar Color', column(4, numericInput("ncolbar2", "Number of Colors", value = 0, min = 0)), column(4, uiOutput("ui_ncolbar2")) ) ) ), column(6, plotOutput('bbar_plot_2', height = '400px') ) ), tabPanel("Shading & Axis Options", column(6, tabsetPanel(type = 'tabs', tabPanel('Axes', column(4, selectInput('bar2_axes', 'Axes', choices = c("TRUE" = TRUE, "FALSE" = FALSE), selected = "TRUE"), numericInput('bar2_axislty', 'Line Type: ', value = 0, min = 0), numericInput('bar2_offset', 'Offset: ', value = 0, min = 0) ) ) ) ), column(6, plotOutput('bbar_plot_3', height = '400px') ) ), tabPanel("Legend", column(6, tabsetPanel(type = 'tabs', tabPanel('General', br(), flowLayout( selectInput('bar2_leg_yn', 'Create Legend', choices = c("TRUE" = TRUE, "FALSE" = FALSE), selected = "FALSE") ), br(), h4('Axis Position', align = 'left', style = 'color:black'), flowLayout( numericInput('bar2_leg_x', 'X Axis:', value = 1), numericInput('bar2_leg_y', 'Y Axis:', value = 1) ), br(), h4('Legend Names', align = 'left', style = 'color:black'), flowLayout( numericInput('bar2_legnames', 'Select:', value = 0, min = 0, step = 1), uiOutput('ui_bar2_legnames') ), br(), h4('Points', align = 'left', style = 'color:black'), flowLayout( numericInput('bar2_leg_point', 'Select:', value = 0, min = 0, max = 25, step = 1), uiOutput('ui_bar2_legpoint') ) ), tabPanel('Legend Box', flowLayout( selectInput('bar2_leg_boxtype', 'Box Type', choices = c('o', 'n'), selected = 'o'), textInput('bar2_leg_boxcol', 'Box Color', value = 'white'), numericInput('bar2_leg_boxlty', 'Box Border Line', value = 1, min = 1, max = 6, step = 1), numericInput('bar2_leg_boxlwd', 'Box Border Width', value = 1, min = 0, step = 0.1), textInput('bar2_leg_boxborcol', 'Box Border Color', value = 'black'), numericInput('bar2_leg_boxxjust', 'Horizontal Justification', value = 0, min = 0, max = 1), numericInput('bar2_leg_boxyjust', 'Vertical Justification', value = 1, min = 0, max = 1) ) ), tabPanel('Legend Text', flowLayout( selectInput('bar2_leg_texthoriz', 'Horizontal Text', choices = c(TRUE, FALSE), selected = FALSE), textInput('bar2_leg_textcol', 'Text Color', value = 'black'), textInput('bar2_leg_title', 'Title', value = ''), numericInput('bar2_leg_textfont', 'Text Font', value = 1, min = 1, max = 5, step = 1), numericInput('bar2_leg_textcolumns', 'Columns', value = 1, min = 0, step = 1), textInput('bar2_leg_titlecol', 'Title Color', value = 'black'), numericInput('bar2_leg_textadj', 'Text Horizontal Adj', value = 0.5, min = 0, max = 1, step = 0.1) ) ) ) ), column(6, plotOutput('bbar_plot_4', height = '400px') ) ), tabPanel("Others", column(6, tabsetPanel(type = 'tabs', tabPanel('Color', flowLayout( textInput('bar2_colaxis', 'Axis Color: ', 'black'), textInput('bar2_coltitle', 'Title Color: ', 'black'), textInput('bar2_collabel', 'Label Color: ', 'black') ) ), tabPanel('Size', flowLayout( numericInput('bar2_cexmain', 'Title Size: ', value = 1, min = 0.1, step = 0.1 ), numericInput('bar2_cexaxis', 'Axis Size: ', value = 1, min = 0.1, step = 0.1 ), numericInput('bar2_cexlab', 'Label Size: ', value = 1, min = 0.1, step = 0.1 ) ) ), tabPanel('Font', flowLayout( numericInput('bar2_fontmain', 'Title Font', value = 1, min = 1, max = 5, step = 1 ), numericInput('bar2_fontaxis', 'Axis Font', value = 1, min = 1, max = 5, step = 1 ), numericInput('bar2_fontlab', 'Label Font', value = 1, min = 1, max = 5, step = 1 ) ) ), tabPanel('Text', flowLayout( numericInput( inputId = "bar2_text_x_loc", label = "X Intercept: ", value = 1, step = 1 ), numericInput( inputId = "bar2_text_y_loc", label = "Y Intercept: ", value = 1, step = 1 ), textInput(inputId = "ubar_plottext", label = "Text:", value = ""), numericInput( inputId = "bar2_textfont", label = "Text Font: ", value = 1, min = 1, max = 5, step = 1 ), textInput( inputId = "bar2_textcolor", label = "Text Color: ", value = "black" ), numericInput( inputId = "bar2_textsize", label = "Text Size: ", value = 1, min = 0.1, step = 0.1 ) ) ), tabPanel('Marginal Text', flowLayout( textInput(inputId = "bar2_mtextplot", label = "Text:", value = ""), numericInput( inputId = "bar2_mtext_side", label = "Side: ", value = 1, min = 1, max = 4, step = 1 ), numericInput( inputId = "bar2_mtext_line", label = "Line: ", value = 1, step = 1 ), numericInput( inputId = "bar2_mtextadj", label = "Adj: ", value = 0.5, min = 0, max = 1, step = 0.1 ), numericInput( inputId = "bar2_mtextfont", label = "Text Font: ", value = 1, min = 1, max = 5, step = 1 ), textInput( inputId = "bar2_mtextcolor", label = "Text Color: ", value = "black" ), numericInput( inputId = "bar2_mtextsize", label = "Text Size: ", value = 1, min = 0.1, step = 0.1 ) ) ) ) ), column(6, plotOutput('bbar_plot_5', height = '400px') ) ), tabPanel('Plot', fluidRow( column(8, offset = 2, plotOutput('bbar_plot_final') ) ) ) ) ) ) ) )
/scratch/gouwar.j/cran-all/cranData/xplorerr/inst/app-visualize/ui/ui_bar2.R
tabPanel('Bar Plot', value = 'tab_bar_plot_1', fluidPage( fluidRow( column(12, align = 'left', h4('Bar Plot - I') ) ), hr(), fluidRow( column(12, tabsetPanel(type = 'tabs', tabPanel('plotly', fluidRow( column(2, selectInput('barly1_select_x', 'Variable: ', choices = "", selected = ""), textInput(inputId = "barly1_xlabel", label = "X Axes Label: ", value = "label"), textInput(inputId = "barly1_color", label = "Color: ", value = "blue") ), column(2, textInput(inputId = "barly1_title", label = "Title: ", value = "title"), textInput(inputId = "barly1_ylabel", label = "Y Axes Label: ", value = "label"), textInput(inputId = "barly1_btext", label = "Text: ", value = "") ), column(8, align = 'center', plotly::plotlyOutput('barly1_plot_1', height = '600px') ) ) ), tabPanel('rbokeh', fluidRow( column(2, selectInput('bobar1_select_x', 'Variable: ', choices = "", selected = ""), textInput(inputId = "bobar1_xlabel", label = "X Axes Label: ", value = "label"), textInput(inputId = "bobar1_color", label = "Color: ", value = ""), selectInput('bobar1_hover', 'Hover: ', choices = c("TRUE" = TRUE, "FALSE" = FALSE), selected = "TRUE" ), textInput(inputId = "bobar1_lcolor", label = "Line Color: ", value = ""), selectInput('bobar1_xgrid', 'X Axis Grid: ', choices = c("TRUE" = TRUE, "FALSE" = FALSE), selected = "TRUE" ) ), column(2, textInput(inputId = "bobar1_title", label = "Title: ", value = "title"), textInput(inputId = "bobar1_ylabel", label = "Y Axes Label: ", value = "label"), numericInput(inputId = "bobar1_alpha", label = "Alpha: ", value = 1, min = 0, max = 1, step = 0.1), numericInput(inputId = "bobar1_width", label = "Width: ", value = 0.9, min = 0, step = 0.1), numericInput(inputId = "bobar1_lalpha", label = "Line Alpha: ", value = 1, min = 0, max = 1, step = 0.1), selectInput('bobar1_ygrid', 'Y Axis Grid: ', choices = c("TRUE" = TRUE, "FALSE" = FALSE), selected = "TRUE" ) ), column(8, align = 'center', rbokeh::rbokehOutput('bobar1_plot_1', height = '600px') ) ) ), tabPanel('highcharts', fluidRow( column(2, selectInput('hibar1_select_x', 'Variable: ', choices = "", selected = ""), textInput(inputId = "hibar1_xlabel", label = "X Axes Label: ", value = "label") ), column(2, textInput(inputId = "hibar1_title", label = "Title: ", value = "title"), textInput(inputId = "hibar1_ylabel", label = "Y Axes Label: ", value = "label") ), column(8, align = 'center', highcharter::highchartOutput('hibar1_plot_1', height = '600px') ) ) ) ) ) ) ) )
/scratch/gouwar.j/cran-all/cranData/xplorerr/inst/app-visualize/ui/ui_bar_plot_1.R
tabPanel('2 Factor Bar Plot', value = 'tab_bar_plot_2', fluidPage( fluidRow( column(12, align = 'left', h4('Bar Plot - II') ) ), hr(), fluidRow( column(12, tabsetPanel(type = 'tabs', tabPanel('plotly', fluidRow( column(2, selectInput('barly2_select_x', 'Variable 1: ', choices = "", selected = ""), textInput(inputId = "barly2_xlabel", label = "X Axes Label: ", value = "label"), textInput(inputId = "barly2_title", label = "Title: ", value = "title") ), column(2, selectInput('barly2_select_y', 'Variable 2: ', choices = "", selected = ""), textInput(inputId = "barly2_ylabel", label = "Y Axes Label: ", value = "label") ), column(8, align = 'center', plotly::plotlyOutput('barly2_plot_1', height = '600px') ) ) ), tabPanel('rbokeh', fluidRow( column(2, selectInput('bobar2_select_x', 'Variable 1: ', choices = "", selected = ""), selectInput('bobar2_type', 'Type: ', choices = c("Stacked" = "stack", "Grouped" = "dodge", "Proportional" = "fill"), selected = "Stacked"), textInput(inputId = "bobar2_xlabel", label = "X Axes Label: ", value = "label"), textInput(inputId = "bobar2_title", label = "Title: ", value = "title"), selectInput('bobar2_xgrid', 'X Axis Grid: ', choices = c("TRUE" = TRUE, "FALSE" = FALSE), selected = "TRUE" ), numericInput(inputId = "bobar2_width", label = "Width: ", value = 0.9, min = 0, step = 0.1) ), column(2, selectInput('bobar2_select_y', 'Variable 2: ', choices = "", selected = ""), selectInput('bobar2_legloc', 'Legend: ', choices = c("Top Right" = "top_right", "Top Left" = "top_left", "Bottom Right" = "bottom_right", "Bottom Left" = "bottom_left", "Omit" = "NULL"), selected = "Top Right" ), textInput(inputId = "bobar2_ylabel", label = "Y Axes Label: ", value = "label"), selectInput('bobar2_hover', 'Hover: ', choices = c("TRUE" = TRUE, "FALSE" = FALSE), selected = "TRUE" ), selectInput('bobar2_ygrid', 'Y Axis Grid: ', choices = c("TRUE" = TRUE, "FALSE" = FALSE), selected = "TRUE" ), numericInput(inputId = "bobar2_alpha", label = "Alpha: ", value = 1, min = 0, max = 1, step = 0.1) ), column(8, align = 'center', rbokeh::rbokehOutput('bobar2_plot_1', height = '600px') ) ) ), tabPanel('highcharts', fluidRow( column(2, selectInput('hibar2_select_x', 'Variable 1: ', choices = "", selected = ""), selectInput('hibar2_horiz', 'Horizontal', choices = c("TRUE" = TRUE, "FALSE" = FALSE), selected = "FALSE", width = '150px') # textInput(inputId = "hibar2_xlabel", label = "X Axes Label: ", # value = "label"), # textInput(inputId = "hibar2_title", label = "Title: ", # value = "title") ), column(2, selectInput('hibar2_select_y', 'Variable 2: ', choices = "", selected = ""), selectInput('hibar2_stack', 'Stacked', choices = c("TRUE" = TRUE, "FALSE" = FALSE), selected = "FALSE", width = '150px') # textInput(inputId = "hibar2_ylabel", label = "Y Axes Label: ", # value = "label") ), column(8, align = 'center', highcharter::highchartOutput('hibar2_plot_1', height = '600px') ) ) ) ) ) ) ) )
/scratch/gouwar.j/cran-all/cranData/xplorerr/inst/app-visualize/ui/ui_bar_plot_2.R
tabPanel('Base', value = 'tab_base', icon = icon('bar-chart'), navlistPanel(id = 'navlist_base', well = FALSE, widths = c(2, 10), source('ui/ui_bar.R', local = TRUE)[[1]], source('ui/ui_bar2.R', local = TRUE)[[1]], source('ui/ui_box.R', local = TRUE)[[1]], source('ui/ui_box2.R', local = TRUE)[[1]], source('ui/ui_hist.R', local = TRUE)[[1]], source('ui/ui_scatter.R', local = TRUE)[[1]], source('ui/ui_pie.R', local = TRUE)[[1]], source('ui/ui_pie3d.R', local = TRUE)[[1]], source('ui/ui_line.R', local = TRUE)[[1]] ) )
/scratch/gouwar.j/cran-all/cranData/xplorerr/inst/app-visualize/ui/ui_base.R
tabPanel('Box Plot', value = 'tab_box', fluidPage( fluidRow( column(12, align = 'left', h4('Box Plot') ) ), hr(), fluidRow( column(12, tabsetPanel(type = 'tabs', # variable selection tabPanel('Variables', # user interface column(6, column(6, align = 'center', # select variable selectInput('ubox_select', 'Select Variable: ', choices = "", selected = "" ), # X axes label textInput(inputId = "ubox_xlabel", label = "X Axes Label", value = "Label"), # color textInput(inputId = "ubox_colour", label = "Color", value = "blue") ), column(6, align = 'center', # plot title textInput(inputId = "ubox_title", label = "Title", value = "Title"), # Y axes label textInput(inputId = "ubox_ylabel", label = "Y Axes Label", value = "Label"), # border color textInput(inputId = "ubox_borcolour", label = "Border Color", value = "black") ) ), # plot column(6, plotOutput('ubox_plot_1') ) ), # box chart options tabPanel('Box Options', # user interface column(6, column(6, align = 'center', # horizontal selectInput('ubox_horiz', 'Horizontal', choices = c("TRUE" = TRUE, "FALSE" = FALSE), selected = "FALSE" ), # range numericInput('ubox_range', 'Range', min = 0, value = 1.5, step = 0.5), # varwidth selectInput('ubox_varwidth', 'Varwidth', choices = c("TRUE" = TRUE, "FALSE" = FALSE), selected = "FALSE" ), # notch selectInput('ubox_notch', 'Notch', choices = c("TRUE" = TRUE, "FALSE" = FALSE), selected = "FALSE" ), # outline selectInput('ubox_outline', 'Outline', choices = c("TRUE" = TRUE, "FALSE" = FALSE), selected = "TRUE" ) ) ), # plot column(6, plotOutput('ubox_plot_2') ) ), tabPanel('Text', column(6, tabsetPanel(type = 'tabs', tabPanel('Text (Inside Plot)', flowLayout( # x axis location numericInput( inputId = "ubox_text_x_loc", label = "X Intercept: ", value = 1, step = 1 ), # y axis location numericInput( inputId = "ubox_text_y_loc", label = "Y Intercept: ", value = 1, step = 1 ), # text textInput(inputId = "ubox_plottext", label = "Text:", value = ""), # text font numericInput( inputId = "ubox_textfont", label = "Text Font: ", value = 1, min = 1, max = 5, step = 1 ), # text color textInput( inputId = "ubox_textcolor", label = "Text Color: ", value = "black" ), # text size numericInput( inputId = "ubox_textsize", label = "Text Size: ", value = 1, min = 0.1, step = 0.1 ) ) ), tabPanel('Marginal Text', flowLayout( # text textInput(inputId = "ubox_mtextplot", label = "Text:", value = ""), # text side numericInput( inputId = "ubox_mtext_side", label = "Side: ", value = 1, min = 1, max = 4, step = 1 ), # text line numericInput( inputId = "ubox_mtext_line", label = "Line: ", value = 1, step = 1 ), # text adjustment numericInput( inputId = "ubox_mtextadj", label = "Adj: ", value = 0.5, min = 0, max = 1, step = 0.1 ), # text font numericInput( inputId = "ubox_mtextfont", label = "Text Font: ", value = 1, min = 1, max = 5, step = 1 ), # text color textInput( inputId = "ubox_mtextcolor", label = "Text Color: ", value = "black" ), # text size numericInput( inputId = "ubox_mtextsize", label = "Text Size: ", value = 1, min = 0.1, step = 0.1 ) ) ) ) ), column(6, plotOutput('ubox_plot_3') ) ), # graphical parameters tabPanel('Others', column(6, tabsetPanel(type = 'tabs', tabPanel('Color', flowLayout( textInput('ubox_colaxis', 'Axis Color: ', 'black'), textInput('ubox_coltitle', 'Title Color: ', 'black'), textInput('ubox_collabel', 'Label Color: ', 'black'), textInput('ubox_colsub', 'Subtitle Color: ', 'black') ) ), tabPanel('Size', flowLayout( numericInput('ubox_cexmain', 'Title Size: ', value = 1, min = 0.1, step = 0.1 ), numericInput('ubox_cexsub', 'Subtitle Size: ', value = 1, min = 0.1, step = 0.1 ), numericInput('ubox_cexaxis', 'Axis Size: ', value = 1, min = 0.1, step = 0.1 ), numericInput('ubox_cexlab', 'Label Size: ', value = 1, min = 0.1, step = 0.1 ) ) ), tabPanel('Font', flowLayout( numericInput('ubox_fontmain', 'Title Font', value = 1, min = 1, max = 5, step = 1 ), numericInput('ubox_fontsub', 'Subtitle Font', value = 1, min = 1, max = 5, step = 1 ), numericInput('ubox_fontaxis', 'Axis Font', value = 1, min = 1, max = 5, step = 1 ), numericInput('ubox_fontlab', 'Label Font', value = 1, min = 1, max = 5, step = 1 ) ) ) ) ), column(6, plotOutput('ubox_plot_4') ) ), # final plot tabPanel('Plot', fluidRow( column(8, offset = 2, plotOutput('ubox_plot_final', height = '500px') ) ) ) ) ) ) ) )
/scratch/gouwar.j/cran-all/cranData/xplorerr/inst/app-visualize/ui/ui_box.R
tabPanel('2 Factor Box Plot', value = 'tab_box2', fluidPage( fluidRow( column(12, align = 'left', h4('2 Factor Box Plot') ) ), hr(), fluidRow( column(12, tabsetPanel(type = 'tabs', # variable selection tabPanel('Variables', # user interface column(4, column(6, align = 'center', # select variable selectInput('bbox_select_x', 'Select Variable: ', choices = "", selected = "" ), # plot title textInput(inputId = "bbox_title", label = "Title", value = "Title"), # X axes label textInput(inputId = "bbox_xlabel", label = "X Axes Label", value = "Label") ), column(6, align = 'center', # select variable selectInput('bbox_select_y', 'Select Variable: ', choices = "", selected = "" ), # plot title textInput(inputId = "bbox_subtitle", label = "Subtitle", value = "Subtitle"), # Y axes label textInput(inputId = "bbox_ylabel", label = "Y Axes Label", value = "Label") ), br(), br(), column(12, align = 'center', actionButton(inputId = 'box2_create', label = 'Generate Plot') ) ), # plot column(8, plotOutput('bbox_plot_1') ) ), # box chart options tabPanel('Box Options', # user interface column(4, column(6, # horizontal selectInput('bbox_horiz', 'Horizontal', choices = c("TRUE" = TRUE, "FALSE" = FALSE), selected = "FALSE" ), # range numericInput('bbox_range', 'Range', min = 0, value = 1.5, step = 0.5), # varwidth selectInput('bbox_varwidth', 'Varwidth', choices = c("TRUE" = TRUE, "FALSE" = FALSE), selected = "FALSE" ), # notch selectInput('bbox_notch', 'Notch', choices = c("TRUE" = TRUE, "FALSE" = FALSE), selected = "FALSE" ), # outline selectInput('bbox_outline', 'Outline', choices = c("TRUE" = TRUE, "FALSE" = FALSE), selected = "TRUE" ) ) ), # plot column(8, plotOutput('bbox_plot_2') ) ), tabPanel('Color & Labels', column(4, tabsetPanel(type = 'tabs', tabPanel('Color', column(6, numericInput("ncolbox2", "Number of Colors", value = 1, min = 1)), column(6, uiOutput("ui_ncolbox2")) ), tabPanel('Border', column(6, numericInput("nborbox2", "Number of Border Colors", value = 1, min = 1)), column(6, uiOutput("ui_nborbox2")) ), tabPanel('Label', column(6, numericInput("nbox2label", "Number of Labels", value = 1, min = 1)), column(6, uiOutput("ui_nbox2label")) ) ) ), column(8, plotOutput('bbox_plot_3') ) ), # tabPanel("Legend", # column(4, # tabsetPanel(type = 'tabs', # tabPanel('General', # br(), # flowLayout( # selectInput('box2_leg_yn', 'Create Legend', # choices = c("TRUE" = TRUE, "FALSE" = FALSE), # selected = "FALSE") # ), # br(), # h4('Axis Position', align = 'left', style = 'color:black'), # flowLayout( # numericInput('box2_leg_x', 'X Axis:', value = 1), # numericInput('box2_leg_y', 'Y Axis:', value = 1) # ), # br(), # h4('Legend Names', align = 'left', style = 'color:black'), # flowLayout( # numericInput('box2_legnames', 'Select:', value = 0, min = 0, step = 1), # uiOutput('ui_box2_legnames') # ), # br(), # h4('Points', align = 'left', style = 'color:black'), # flowLayout( # numericInput('box2_leg_point', 'Select:', value = 0, min = 0, max = 25, step = 1), # uiOutput('ui_box2_legpoint') # ) # ), # tabPanel('Legend Box', # flowLayout( # selectInput('box2_leg_boxtype', 'Box Type', choices = c('o', 'n'), selected = 'o'), # textInput('box2_leg_boxcol', 'Box Color', value = 'white'), # numericInput('box2_leg_boxlty', 'Box Border Line', value = 1, min = 1, max = 6, step = 1), # numericInput('box2_leg_boxlwd', 'Box Border Width', value = 1, min = 0, step = 0.1), # textInput('box2_leg_boxborcol', 'Box Border Color', value = 'black'), # numericInput('box2_leg_boxxjust', 'Horizontal Justification', value = 0, min = 0, max = 1), # numericInput('box2_leg_boxyjust', 'Vertical Justification', value = 1, min = 0, max = 1) # ) # ), # tabPanel('Legend Text', # flowLayout( # selectInput('box2_leg_texthoriz', 'Horizontal Text', choices = c(TRUE, FALSE), selected = FALSE), # textInput('box2_leg_textcol', 'Text Color', value = 'black'), # textInput('box2_leg_title', 'Title', value = ''), # numericInput('box2_leg_textfont', 'Text Font', value = 1, min = 1, max = 5, step = 1), # numericInput('box2_leg_textcolumns', 'Columns', value = 1, min = 0, step = 1), # textInput('box2_leg_titlecol', 'Title Color', value = 'black'), # numericInput('box2_leg_textadj', 'Text Horizontal Adj', value = 0.5, min = 0, max = 1, step = 0.1) # ) # ) # ) # ), # column(8, # plotOutput('bbox_plot_4', height = '400px') # ) # ), tabPanel('Text', column(4, tabsetPanel(type = 'tabs', tabPanel('Text (Inside Plot)', flowLayout( # x axis location numericInput( inputId = "bbox_text_x_loc", label = "X Intercept: ", value = 1, step = 1 ), # y axis location numericInput( inputId = "bbox_text_y_loc", label = "Y Intercept: ", value = 1, step = 1 ), # text textInput(inputId = "bbox_plottext", label = "Text:", value = ""), # text font numericInput( inputId = "bbox_textfont", label = "Text Font: ", value = 1, min = 1, max = 5, step = 1 ), # text color textInput( inputId = "bbox_textcolor", label = "Text Color: ", value = "black" ), # text size numericInput( inputId = "bbox_textsize", label = "Text Size: ", value = 1, min = 0.1, step = 0.1 ) ) ), tabPanel('Marginal Text', flowLayout( # text textInput(inputId = "bbox_mtextplot", label = "Text:", value = ""), # text side numericInput( inputId = "bbox_mtext_side", label = "Side: ", value = 1, min = 1, max = 4, step = 1 ), # text line numericInput( inputId = "bbox_mtext_line", label = "Line: ", value = 1, step = 1 ), # text adjustment numericInput( inputId = "bbox_mtextadj", label = "Adj: ", value = 0.5, min = 0, max = 1, step = 0.1 ), # text font numericInput( inputId = "bbox_mtextfont", label = "Text Font: ", value = 1, min = 1, max = 5, step = 1 ), # text color textInput( inputId = "bbox_mtextcolor", label = "Text Color: ", value = "black" ), # text size numericInput( inputId = "bbox_mtextsize", label = "Text Size: ", value = 1, min = 0.1, step = 0.1 ) ) ) ) ), column(8, plotOutput('bbox_plot_5') ) ), tabPanel('Others', column(4, tabsetPanel(type = 'tabs', tabPanel('Color', flowLayout( textInput('bbox_colaxis', 'Axis Color: ', 'black'), textInput('bbox_coltitle', 'Title Color: ', 'black'), textInput('bbox_collabel', 'Label Color: ', 'black'), textInput('bbox_colsub', 'Subtitle Color: ', 'black') ) ), tabPanel('Size', flowLayout( numericInput('bbox_cexmain', 'Title Size: ', value = 1, min = 0.1, step = 0.1 ), numericInput('bbox_cexsub', 'Subtitle Size: ', value = 1, min = 0.1, step = 0.1 ), numericInput('bbox_cexaxis', 'Axis Size: ', value = 1, min = 0.1, step = 0.1 ), numericInput('bbox_cexlab', 'Label Size: ', value = 1, min = 0.1, step = 0.1 ) ) ), tabPanel('Font', flowLayout( numericInput('bbox_fontmain', 'Title Font', value = 1, min = 1, max = 5, step = 1 ), numericInput('bbox_fontsub', 'Subtitle Font', value = 1, min = 1, max = 5, step = 1 ), numericInput('bbox_fontaxis', 'Axis Font', value = 1, min = 1, max = 5, step = 1 ), numericInput('bbox_fontlab', 'Label Font', value = 1, min = 1, max = 5, step = 1 ) ) ) ) ), column(8, plotOutput('bbox_plot_6') ) ), # final plot tabPanel('Plot', fluidRow( column(8, offset = 2, plotOutput('bbox_plot_final', height = '500px') ) ) ) ) ) ) ) )
/scratch/gouwar.j/cran-all/cranData/xplorerr/inst/app-visualize/ui/ui_box2.R
tabPanel('Box Plot', value = 'tab_box_plot_1', fluidPage( fluidRow( column(12, align = 'left', h4('Box Plot - I') ) ), hr(), fluidRow( column(12, tabsetPanel(type = 'tabs', tabPanel('plotly', fluidRow( column(2, selectInput('boxly1_select_x', 'Variable 1: ', choices = "", selected = ""), textInput(inputId = "boxly1_xlabel", label = "X Axes Label: ", value = "label") ), column(2, textInput(inputId = "boxly1_title", label = "Title: ", value = "title"), textInput(inputId = "boxly1_ylabel", label = "Y Axes Label: ", value = "label") ), column(8, align = 'center', plotly::plotlyOutput('boxly1_plot_1', height = '600px') ) ) ), tabPanel('rbokeh', fluidRow( column(2, selectInput('bobox1_select_x', 'Variable: ', choices = "", selected = ""), textInput(inputId = "bobox1_xlabel", label = "X Axes Label: ", value = "label"), textInput(inputId = "bobox1_color", label = "Color: ", value = ""), numericInput(inputId = "bobox1_oshape", label = "Outlier Shape: ", value = 1, min = 0, max = 25, step = 1), numericInput(inputId = "bobox1_width", label = "Width: ", value = 0.9, min = 0, max = 1, step = 0.1), selectInput('bobox1_xgrid', 'X Axis Grid: ', choices = c("TRUE" = TRUE, "FALSE" = FALSE), selected = "TRUE") ), column(2, textInput(inputId = "bobox1_title", label = "Title: ", value = "title"), textInput(inputId = "bobox1_ylabel", label = "Y Axes Label: ", value = "label"), numericInput(inputId = "bobox1_alpha", label = "Alpha: ", value = 1, min = 0, max = 1, step = 0.1), numericInput(inputId = "bobox1_osize", label = "Outlier Size: ", value = 10, min = 0, step = 1), textInput(inputId = "bobox1_lcolor", label = "Line Color: ", value = ""), selectInput('bobox1_ygrid', 'Y Axis Grid: ', choices = c("TRUE" = TRUE, "FALSE" = FALSE), selected = "TRUE") ), column(8, align = 'center', rbokeh::rbokehOutput('bobox1_plot_1', height = '600px') ) ) ) ) ) ) ) )
/scratch/gouwar.j/cran-all/cranData/xplorerr/inst/app-visualize/ui/ui_box_plot_1.R
tabPanel('2 Factor Box Plot', value = 'tab_box_plot_2', fluidPage( fluidRow( column(12, align = 'left', h4('Box Plot - II') ) ), hr(), fluidRow( column(12, tabsetPanel(type = 'tabs', tabPanel('plotly', fluidRow( column(2, selectInput('boxly2_select_x', 'Variable 1: ', choices = "", selected = ""), textInput(inputId = "boxly2_xlabel", label = "X Axes Label: ", value = "label"), textInput(inputId = "boxly2_title", label = "Title: ", value = "title") ), column(2, selectInput('boxly2_select_y', 'Variable 2: ', choices = "", selected = ""), textInput(inputId = "boxly2_ylabel", label = "Y Axes Label: ", value = "label") ), column(8, align = 'center', plotly::plotlyOutput('boxly2_plot_1', height = '600px') ) ) ), tabPanel('rbokeh', fluidRow( column(2, selectInput('bobox2_select_x', 'Variable 1: ', choices = "", selected = ""), numericInput(inputId = "bobox2_oshape", label = "Outlier Shape: ", value = 1, min = 0, max = 25, step = 1), numericInput(inputId = "bobox2_width", label = "Width: ", value = 0.9, min = 0, max = 1, step = 0.1), selectInput('bobox2_xgrid', 'X Axis Grid: ', choices = c("TRUE" = TRUE, "FALSE" = FALSE), selected = "TRUE"), textInput(inputId = "bobox2_xlabel", label = "X Axes Label: ", value = "label"), textInput(inputId = "bobox2_title", label = "Title: ", value = "title") ), column(2, selectInput('bobox2_select_y', 'Variable 2: ', choices = "", selected = ""), numericInput(inputId = "bobox2_osize", label = "Outlier Size: ", value = 10, min = 0, step = 1), numericInput(inputId = "bobox2_alpha", label = "Alpha: ", value = 1, min = 0, max = 1, step = 0.1), selectInput('bobox2_ygrid', 'Y Axis Grid: ', choices = c("TRUE" = TRUE, "FALSE" = FALSE), selected = "TRUE"), textInput(inputId = "bobox2_ylabel", label = "Y Axes Label: ", value = "label") ), column(8, align = 'center', rbokeh::rbokehOutput('bobox2_plot_1', height = '600px') ) ) ), tabPanel('highcharts', fluidRow( column(2, selectInput('hibox2_select_x', 'Variable 1: ', choices = "", selected = ""), textInput(inputId = "hibox2_xlabel", label = "X Axes Label: ", value = "label"), textInput(inputId = "hibox2_title", label = "Title: ", value = "title") ), column(2, selectInput('hibox2_select_y', 'Variable 2: ', choices = "", selected = ""), textInput(inputId = "hibox2_ylabel", label = "Y Axes Label: ", value = "label") ), column(8, align = 'center', highcharter::highchartOutput('hibox2_plot_1', height = '600px') ) ) ) ) ) ) ) )
/scratch/gouwar.j/cran-all/cranData/xplorerr/inst/app-visualize/ui/ui_box_plot_2.R
navbarMenu('Data', icon = icon('database'), source('ui/ui_up.R', local = TRUE)[[1]], source('ui/ui_trans.R', local = TRUE)[[1]], source('ui/ui_scr.R', local = TRUE)[[1]], source('ui/ui_vi.R', local = TRUE)[[1]] )
/scratch/gouwar.j/cran-all/cranData/xplorerr/inst/app-visualize/ui/ui_data.R
tabPanel('Upload File', value = 'tab_uploadfile', fluidPage( includeCSS("mystyle.css"), fluidRow( column(12, tabsetPanel(type = 'tabs', id = 'tabset_upload', tabPanel('CSV', value = 'tab_upload_csv', fluidPage( br(), fluidRow( column(8, align = 'left', h4('Upload Data'), p('Upload data from a comma or tab separated file.') ), column(4, align = 'right', actionButton(inputId='uploadlink2', label="Demo", icon = icon("video-camera"), onclick ="window.open('https://www.youtube.com/watch?v=IckaPr19Bvc#t=00m29s', '_blank')") ) ), hr(), fluidRow( column(12, align = 'center', fileInput('file1', 'Data Set:', accept = c('text/csv', '.csv', 'text/comma-separated-values,text/plain') ) ) ), fluidRow( column(12, align = 'center', checkboxInput('header', 'Header', TRUE)) ), fluidRow( column(12, align = 'center', selectInput('sep', 'Separator', choices = c('Comma' = ',', 'Semicolon' = ';', 'Tab' = '\t'), selected = ',') ) ), fluidRow( column(12, align = 'center', selectInput('quote', 'Quote', choices = c('None' = '', 'Double Quote' = '"', 'Single Quote' = "'"), selected = '') ) ), br(), br(), br(), fluidRow( column(6, align = 'left', actionButton(inputId='csv2datasrc', label="Data Sources", icon = icon("long-arrow-left")) ), column(6, align = 'right', actionButton(inputId='csv2datatrans', label="Data Selection", icon = icon("long-arrow-right")) ) ) ) ), tabPanel('Excel', value = 'tab_upload_excel', fluidPage( br(), fluidRow( column(8, align = 'left', h4('Upload Data'), p('Upload data from a .xls or .xlsx file.') ), column(4, align = 'right', actionButton(inputId='uploadexcel2', label="Demo", icon = icon("video-camera"), onclick ="window.open('https://www.youtube.com/watch?v=IckaPr19Bvc#t=00m29s', '_blank')") ) ), hr(), fluidRow( column(12, align = 'center', fileInput( inputId = 'file2', label = 'Choose file:', accept = c('.xls', '.xlsx') ) ) ), fluidRow( column(12, align = 'center', numericInput( inputId = 'sheet_n', label = 'Sheet', value = 1, min = 1, step = 1, width = '120px' ) ) ), br(), br(), br(), br(), br(), br(), br(), br(), br(), fluidRow( column(6, align = 'left', actionButton(inputId='excel2datasrc', label="Data Sources", icon = icon("long-arrow-left")) ), column(6, align = 'right', actionButton(inputId='excel2datatrans', label="Data Selection", icon = icon("long-arrow-right")) ) ) ) ), tabPanel('JSON', value = 'tab_upload_json', br(), fluidPage( fluidRow( column(8, align = 'left', h4('Upload Data'), p('Upload data from a .json file.') ), column(4, align = 'right', actionButton(inputId='uploadjson2', label="Demo", icon = icon("video-camera"), onclick ="window.open('https://www.youtube.com/watch?v=IckaPr19Bvc#t=00m29s', '_blank')") ) ), hr(), fluidRow( column(12, align = 'center', fileInput( inputId = 'file3', label = 'Choose file:', accept = '.json' ) ) ), br(), br(), br(), br(), br(), br(), br(), br(), br(), br(), br(), br(), br(), fluidRow( column(6, align = 'left', actionButton(inputId='json2datasrc', label="Data Sources", icon = icon("long-arrow-left")) ), column(6, align = 'right', actionButton(inputId='json2datatrans', label="Data Selection", icon = icon("long-arrow-right")) ) ) ) ), tabPanel('STATA', value = 'tab_upload_stata', br(), fluidPage( fluidRow( column(8, align = 'left', h4('Upload Data'), p('Upload data from a .dta file.') ), column(4, align = 'right', actionButton(inputId='uploadstata2', label="Demo", icon = icon("video-camera"), onclick ="window.open('https://www.youtube.com/watch?v=IckaPr19Bvc#t=00m29s', '_blank')") ) ), hr(), fluidRow( column(12, align = 'center', fileInput( inputId = 'file6', label = 'Choose file:', accept = '.dta' ) ) ), br(), br(), br(), br(), br(), br(), br(), br(), br(), br(), br(), br(), br(), fluidRow( column(6, align = 'left', actionButton(inputId='stata2datasrc', label="Data Sources", icon = icon("long-arrow-left")) ), column(6, align = 'right', actionButton(inputId='stata2datatrans', label="Data Selection", icon = icon("long-arrow-right")) ) ) ) ), tabPanel('SPSS', value = 'tab_upload_spss', br(), fluidPage( fluidRow( column(8, align = 'left', h4('Upload Data'), p('Upload data from a .sav file.') ), column(4, align = 'right', actionButton(inputId='uploadspss2', label="Demo", icon = icon("video-camera"), onclick ="window.open('https://www.youtube.com/watch?v=IckaPr19Bvc#t=00m29s', '_blank')") ) ), hr(), fluidRow( column(12, align = 'center', fileInput( inputId = 'file5', label = 'Choose file:', accept = '.sav' ) ) ), br(), br(), br(), br(), br(), br(), br(), br(), br(), br(), br(), br(), br(), fluidRow( column(6, align = 'left', actionButton(inputId='spss2datasrc', label="Data Sources", icon = icon("long-arrow-left")) ), column(6, align = 'right', actionButton(inputId='spss2datatrans', label="Data Selection", icon = icon("long-arrow-right")) ) ) ) ), tabPanel('SAS', value = 'tab_upload_sas', br(), fluidPage( fluidRow( column(8, align = 'left', h4('Upload Data'), p('Upload data from a .sas7bdat file.') ), column(4, align = 'right', actionButton(inputId='uploadsas2', label="Demo", icon = icon("video-camera"), onclick ="window.open('https://www.youtube.com/watch?v=IckaPr19Bvc#t=00m29s', '_blank')") ) ), hr(), fluidRow( column(12, align = 'center', fileInput( inputId = 'file4', label = 'Choose file:', accept = '.sas7bdat' ) ) ), br(), br(), br(), br(), br(), br(), br(), br(), br(), br(), br(), br(), br(), fluidRow( column(6, align = 'left', actionButton(inputId='sas2datasrc', label="Data Sources", icon = icon("long-arrow-left")) ), column(6, align = 'right', actionButton(inputId='sas2datatrans', label="Data Selection", icon = icon("long-arrow-right")) ) ) ) ), tabPanel('RDS', value = 'tab_upload_rds', br(), fluidPage( fluidRow( column(8, align = 'left', h4('Upload Data'), p('Upload data from a RDS file.') ), column(4, align = 'right', actionButton(inputId='uploadrds2', label="Demo", icon = icon("video-camera"), onclick ="window.open('https://www.youtube.com/watch?v=IckaPr19Bvc#t=00m29s', '_blank')") ) ), hr(), fluidRow( column(12, align = 'center', fileInput( inputId = 'file7', label = 'Choose file:', accept = '' ) ) ), br(), br(), br(), br(), br(), br(), br(), br(), br(), br(), br(), br(), br(), fluidRow( column(6, align = 'left', actionButton(inputId='rds2datasrc', label="Data Sources", icon = icon("long-arrow-left")) ), column(6, align = 'right', actionButton(inputId='rds2datatrans', label="Data Selection", icon = icon("long-arrow-right")) ) ) ) ) ) ) ) ) )
/scratch/gouwar.j/cran-all/cranData/xplorerr/inst/app-visualize/ui/ui_datafiles.R
tabPanel('Data Sources', value = 'tab_datasources', fluidPage(theme = shinytheme('cerulean'), includeCSS("mystyle.css"), fluidRow( column(12, align = 'center', h4('Use sample data or upload a file') ) ), fluidRow( column(6, align = 'right', actionButton( inputId = 'sample_data_yes', label = 'Sample Data', width = '120px' ) ), column(6, align = 'left', actionButton( inputId = 'upload_files_yes', label = 'Upload File', width = '120px' ) ) ), br(), fluidRow( column(12, align = 'center', h6('The app takes a few seconds to load. Please wait for ~12 seconds.') ) ), br(), br(), fluidRow( uiOutput('upload_file_links') ) ) )
/scratch/gouwar.j/cran-all/cranData/xplorerr/inst/app-visualize/ui/ui_dataoptions.R
tabPanel('Sample Data', value = 'tab_use_sample', fluidPage( includeCSS("mystyle.css"), fluidRow( column(12, align = 'center', h5('Click on a sample for more information') ) ), br(), fluidRow( column(4, align = 'center', actionButton( inputId = 'german_data', label = 'German Credit', width = '200px', onclick ="window.open('https://archive.ics.uci.edu/ml/datasets/Statlog+(German+Credit+Data)', 'newwindow', 'width=800,height=600')" ) ), column(4, align = 'center', actionButton( inputId = 'iris_data', label = 'Iris', width = '200px', onclick ="window.open('https://stat.ethz.ch/R-manual/R-devel/library/datasets/html/iris.html', 'newwindow', 'width=800,height=600')" ) ), column(4, align = 'center', actionButton( inputId = 'mtcars_data', label = 'mtcars', width = '200px', onclick ="window.open('https://stat.ethz.ch/R-manual/R-devel/library/datasets/html/mtcars.html', 'newwindow', 'width=800,height=600')" ) ) ), fluidRow(column(12, br())), fluidRow( column(4, align = 'center', actionButton( inputId = 'mpg_data', label = 'mpg', width = '200px', onclick ="window.open('http://ggplot2.tidyverse.org/reference/mpg.html', 'newwindow', 'width=800,height=600')" ) ), column(4, align = 'center', actionButton( inputId = 'hsb_data', label = 'hsb', width = '200px', onclick ="window.open('http://www.rsquaredacademy.com/descriptr/reference/hsb.html', 'newwindow', 'width=800,height=600')" ) ), column(4, align = 'center', actionButton( inputId = 'diamonds_data', label = 'diamonds', width = '200px', onclick ="window.open('http://ggplot2.tidyverse.org/reference/diamonds.html', 'newwindow', 'width=800,height=600')" ) ) ), br(), br(), br(), fluidRow( column(12, align = 'center', actionButton( inputId = 'use_sample_data', label = 'Use Sample Data', width = '200px' ) ) ) ) )
/scratch/gouwar.j/cran-all/cranData/xplorerr/inst/app-visualize/ui/ui_datasamples.R
# Exit ----------------------------------------------------------- tabPanel("", value = "exit", icon = icon("power-off"), br(), br(), br(), br(), br(), br(), # In case window does not close, one should see this message fluidRow(column(3), column(6, h2("Thank you for using", strong("xplorerr"), "!"))), fluidRow(column(3), column(6, h4("Now you should close this window."))) )
/scratch/gouwar.j/cran-all/cranData/xplorerr/inst/app-visualize/ui/ui_exit_button.R
tabPanel('Filter', value = 'tab_filter', fluidPage( fluidRow( column(6, align = 'left', h4('Filter Data'), p('Click on Yes to filter data.') ), column(6, align = 'right', actionButton(inputId='fildatalink', label="Demo", icon = icon("video-camera"), onclick ="window.open('https://www.youtube.com/watch?v=IckaPr19Bvc#t=02m42s', '_blank')") ) ), hr(), fluidRow( column(12, align = 'center', h4('Do you want to filter data?') ), column(6, align = 'right', actionButton( inputId = 'button_filt_yes', label = 'Yes', width = '120px' ) ), column(6, align = 'left', actionButton( inputId = 'button_filt_no', label = 'No', width = '120px' ) ) ), br(), br(), fluidRow( uiOutput('filt_render') ), fluidRow( uiOutput('filt_trans') ) ) )
/scratch/gouwar.j/cran-all/cranData/xplorerr/inst/app-visualize/ui/ui_filter.R
tabPanel('Bar Plot', value = 'tab_gbar', fluidPage( fluidRow( column(12, align = 'left', h4('Bar Plot') ) ), hr(), fluidRow( column(12, tabsetPanel(type = 'tabs', tabPanel('Variables', fluidRow( column(2, selectInput('gbar_select_x', 'Variable: ', choices = "", selected = ""), textInput(inputId = "gbar_barcol", label = "Bar Color: ", value = "blue"), textInput(inputId = "gbar_title", label = "Title: ", value = "title"), textInput(inputId = "gbar_xlabel", label = "X Axes Label: ", value = "label") ), column(2, selectInput('gbar_horiz', 'Horizontal', choices = c("TRUE" = TRUE, "FALSE" = FALSE), selected = "FALSE"), textInput(inputId = "gbar_borcol", label = "Border Color: ", value = "black"), textInput(inputId = "gbar_subtitle", label = "Subtitle: ", value = "subtitle"), textInput(inputId = "gbar_ylabel", label = "Y Axes Label: ", value = "label") ), column(8, plotOutput('gbar_plot_1', height = '600px') ) ) ), tabPanel('Axis Range', fluidRow( column(2, uiOutput('ui_gbaryrange_min'), selectInput('gbar_remx', 'Remove X Axis Label', choices = c("TRUE" = TRUE, "FALSE" = FALSE), selected = "FALSE") ), column(2, uiOutput('ui_gbaryrange_max'), selectInput('gbar_remy', 'Remove Y Axis Label', choices = c("TRUE" = TRUE, "FALSE" = FALSE), selected = "FALSE") ), column(8, plotOutput('gbar_plot_2', height = '600px') ) ) ), tabPanel('Annotations', fluidRow( column(2, selectInput('gbar_text', 'Add Text', choices = c("TRUE" = TRUE, "FALSE" = FALSE), selected = "FALSE"), numericInput( inputId = "gbar_text_x_loc", label = "X Intercept: ", value = 1, step = 1), numericInput( inputId = "gbar_text_y_loc", label = "Y Intercept: ", value = 1, step = 1 ) ), column(2, textInput(inputId = "gbar_plottext", label = "Text:", value = ""), textInput( inputId = "gbar_textcolor", label = "Text Color: ", value = "black" ), numericInput( inputId = "gbar_textsize", label = "Text Size: ", value = 10, min = 1, step = 1 ) ), column(8, plotOutput('gbar_plot_3', height = '600px') ) ) ), tabPanel('Others', column(4, tabsetPanel(type = 'tabs', tabPanel('Color', fluidRow( column(6, textInput(inputId = "gbar_title_col", label = "Title:", value = "black"), textInput(inputId = "gbar_sub_col", label = "Subtitle:", value = "black"), textInput(inputId = "gbar_xlab_col", label = "X Axis Label:", value = "black"), textInput(inputId = "gbar_ylab_col", label = "Y Axis Label:", value = "black") ) ) ), tabPanel('Font Family', fluidRow( column(6, textInput(inputId = "gbar_title_fam", label = "Title:", value = "Times"), textInput(inputId = "gbar_sub_fam", label = "Subtitle:", value = "Times"), textInput(inputId = "gbar_xlab_fam", label = "X Axis Label:", value = "Times"), textInput(inputId = "gbar_ylab_fam", label = "Y Axis Label:", value = "Times") ) ) ), tabPanel('Font Face', fluidRow( column(6, selectInput('gbar_title_font', 'Title:', choices = c(plain = 'plain', bold = 'bold', italic = 'italic', bold_italic = 'bold.italic'), selected = "plain"), selectInput('gbar_subtitle_font', 'Subtitle:', choices = c(plain = 'plain', bold = 'bold', italic = 'italic', bold_italic = 'bold.italic'), selected = "plain"), selectInput('gbar_xlab_font', 'X Axis Label:', choices = c(plain = 'plain', bold = 'bold', italic = 'italic', bold_italic = 'bold.italic'), selected = "plain"), selectInput('gbar_ylab_font', 'Y Axis Label:', choices = c(plain = 'plain', bold = 'bold', italic = 'italic', bold_italic = 'bold.italic'), selected = "plain") ) ) ), tabPanel('Font Size', fluidRow( column(6, numericInput(inputId = "gbar_title_size", label = "Title:", min = 1, step = 0.1, value = 1), numericInput(inputId = "gbar_sub_size", label = "Subtitle:", min = 1, step = 0.1, value = 1), numericInput(inputId = "gbar_xlab_size", label = "X Axis Label:", min = 1, step = 0.1, value = 1), numericInput(inputId = "gbar_ylab_size", label = "Y Axis Label:", min = 1, step = 0.1, value = 1) ) ) ), tabPanel('Horizontal', fluidRow( column(6, numericInput(inputId = "gbar_title_hjust", label = "Title:", min = 0, step = 0.1, value = 0.5, max = 1), numericInput(inputId = "gbar_sub_hjust", label = "Subtitle:", min = 0, step = 0.1, value = 0.5, max = 1), numericInput(inputId = "gbar_xlab_hjust", label = "X Axis Label:", min = 0, step = 0.1, value = 0.5, max = 1), numericInput(inputId = "gbar_ylab_hjust", label = "Y Axis Label:", min = 0, step = 0.1, value = 0.5, max = 1) ) ) ), tabPanel('Vertical', fluidRow( column(6, numericInput(inputId = "gbar_title_vjust", label = "Title:", min = 0, step = 0.1, value = 0.5, max = 1), numericInput(inputId = "gbar_sub_vjust", label = "Subtitle:", min = 0, step = 0.1, value = 0.5, max = 1), numericInput(inputId = "gbar_xlab_vjust", label = "X Axis Label:", min = 0, step = 0.1, value = 0.5, max = 1), numericInput(inputId = "gbar_ylab_vjust", label = "Y Axis Label:", min = 0, step = 0.1, value = 0.5, max = 1) ) ) ) ) ), column(8, plotOutput('gbar_plot_4', height = '600px') ) ), tabPanel('Theme', column(2, selectInput(inputId = 'gbar_theme', label = 'Theme', choices = list("Classic Dark", "Default", "Light", "Minimal", "Dark", "Classic", "Empty"), selected = "Default") ), column(2), column(8, align = 'center', plotOutput('gbar_plot_5', height = '600px') ) ), tabPanel('Plot', column(12, align = 'center', plotOutput('gbar_plot_6', height = '600px') ) ) ) ) ) ) )
/scratch/gouwar.j/cran-all/cranData/xplorerr/inst/app-visualize/ui/ui_gbar.R
tabPanel('2 Factor Bar Plot', value = 'tab_gbar2', fluidPage( fluidRow( column(12, align = 'left', h4('Bar Plot') ) ), hr(), fluidRow( column(12, tabsetPanel(type = 'tabs', tabPanel('Variables', fluidRow( column(2, selectInput('gbar2_select_x', 'Variable 1: ', choices = "", selected = ""), selectInput('gbar2_stack', 'Stacked: ', choices = c("TRUE" = TRUE, "FALSE" = FALSE), selected = "FALSE"), textInput(inputId = "gbar2_title", label = "Title: ", value = "title"), textInput(inputId = "gbar2_xlabel", label = "X Axes Label: ", value = "label") ), column(2, selectInput('gbar2_select_y', 'Variable 2: ', choices = "", selected = ""), selectInput('gbar2_horiz', 'Horizontal', choices = c("TRUE" = TRUE, "FALSE" = FALSE), selected = "FALSE"), textInput(inputId = "gbar2_subtitle", label = "Subtitle: ", value = "subtitle"), textInput(inputId = "gbar2_ylabel", label = "Y Axes Label: ", value = "label") ), column(8, plotOutput('gbar2_plot_1', height = '600px') ) ) ), tabPanel('Axis Range', fluidRow( column(2, uiOutput('ui_gbar2yrange_min'), selectInput('gbar2_remx', 'Remove X Axis Label', choices = c("TRUE" = TRUE, "FALSE" = FALSE), selected = "FALSE") ), column(2, uiOutput('ui_gbar2yrange_max'), selectInput('gbar2_remy', 'Remove Y Axis Label', choices = c("TRUE" = TRUE, "FALSE" = FALSE), selected = "FALSE") ), column(8, plotOutput('gbar2_plot_2', height = '600px') ) ) ), tabPanel('Annotations', fluidRow( column(2, selectInput('gbar2_text', 'Add Text', choices = c("TRUE" = TRUE, "FALSE" = FALSE), selected = "FALSE"), numericInput( inputId = "gbar2_text_x_loc", label = "X Intercept: ", value = 1, step = 1), numericInput( inputId = "gbar2_text_y_loc", label = "Y Intercept: ", value = 1, step = 1 ) ), column(2, textInput(inputId = "gbar2_plottext", label = "Text:", value = ""), textInput( inputId = "gbar2_textcolor", label = "Text Color: ", value = "black" ), numericInput( inputId = "gbar2_textsize", label = "Text Size: ", value = 10, min = 1, step = 1 ) ), column(8, plotOutput('gbar2_plot_3', height = '600px') ) ) ), tabPanel('Others', column(4, tabsetPanel(type = 'tabs', tabPanel('Color', fluidRow( column(6, textInput(inputId = "gbar2_title_col", label = "Title:", value = "black"), textInput(inputId = "gbar2_sub_col", label = "Subtitle:", value = "black"), textInput(inputId = "gbar2_xlab_col", label = "X Axis Label:", value = "black"), textInput(inputId = "gbar2_ylab_col", label = "Y Axis Label:", value = "black") ) ) ), tabPanel('Font Family', fluidRow( column(6, textInput(inputId = "gbar2_title_fam", label = "Title:", value = "Times"), textInput(inputId = "gbar2_sub_fam", label = "Subtitle:", value = "Times"), textInput(inputId = "gbar2_xlab_fam", label = "X Axis Label:", value = "Times"), textInput(inputId = "gbar2_ylab_fam", label = "Y Axis Label:", value = "Times") ) ) ), tabPanel('Font Face', fluidRow( column(6, selectInput('gbar2_title_font', 'Title:', choices = c(plain = 'plain', bold = 'bold', italic = 'italic', bold_italic = 'bold.italic'), selected = "plain"), selectInput('gbar2_subtitle_font', 'Subtitle:', choices = c(plain = 'plain', bold = 'bold', italic = 'italic', bold_italic = 'bold.italic'), selected = "plain"), selectInput('gbar2_xlab_font', 'X Axis Label:', choices = c(plain = 'plain', bold = 'bold', italic = 'italic', bold_italic = 'bold.italic'), selected = "plain"), selectInput('gbar2_ylab_font', 'Y Axis Label:', choices = c(plain = 'plain', bold = 'bold', italic = 'italic', bold_italic = 'bold.italic'), selected = "plain") ) ) ), tabPanel('Font Size', fluidRow( column(6, numericInput(inputId = "gbar2_title_size", label = "Title:", min = 1, step = 0.1, value = 1), numericInput(inputId = "gbar2_sub_size", label = "Subtitle:", min = 1, step = 0.1, value = 1), numericInput(inputId = "gbar2_xlab_size", label = "X Axis Label:", min = 1, step = 0.1, value = 1), numericInput(inputId = "gbar2_ylab_size", label = "Y Axis Label:", min = 1, step = 0.1, value = 1) ) ) ), tabPanel('Horizontal', fluidRow( column(6, numericInput(inputId = "gbar2_title_hjust", label = "Title:", min = 0, step = 0.1, value = 0.5, max = 1), numericInput(inputId = "gbar2_sub_hjust", label = "Subtitle:", min = 0, step = 0.1, value = 0.5, max = 1), numericInput(inputId = "gbar2_xlab_hjust", label = "X Axis Label:", min = 0, step = 0.1, value = 0.5, max = 1), numericInput(inputId = "gbar2_ylab_hjust", label = "Y Axis Label:", min = 0, step = 0.1, value = 0.5, max = 1) ) ) ), tabPanel('Vertical', fluidRow( column(6, numericInput(inputId = "gbar2_title_vjust", label = "Title:", min = 0, step = 0.1, value = 0.5, max = 1), numericInput(inputId = "gbar2_sub_vjust", label = "Subtitle:", min = 0, step = 0.1, value = 0.5, max = 1), numericInput(inputId = "gbar2_xlab_vjust", label = "X Axis Label:", min = 0, step = 0.1, value = 0.5, max = 1), numericInput(inputId = "gbar2_ylab_vjust", label = "Y Axis Label:", min = 0, step = 0.1, value = 0.5, max = 1) ) ) ) ) ), column(8, plotOutput('gbar2_plot_4', height = '600px') ) ), tabPanel('Theme', column(2, selectInput(inputId = 'gbar2_theme', label = 'Theme', choices = list("Classic Dark", "Default", "Light", "Minimal", "Dark", "Classic", "Empty"), selected = "Default") ), column(2), column(8, align = 'center', plotOutput('gbar2_plot_5', height = '600px') ) ), tabPanel('Plot', column(12, align = 'center', plotOutput('gbar2_plot_6', height = '600px') ) ) ) ) ) ) )
/scratch/gouwar.j/cran-all/cranData/xplorerr/inst/app-visualize/ui/ui_gbar2.R
tabPanel('Box Plot', value = 'tab_gbox', fluidPage( fluidRow( column(12, align = 'left', h4('Box Plot') ) ), hr(), fluidRow( column(12, tabsetPanel(type = 'tabs', tabPanel('Variables', fluidRow( column(2, selectInput('gbox_select_x', 'Variable: ', choices = "", selected = ""), textInput(inputId = "gbox_fill", label = "Bar Color: ", value = "blue"), textInput(inputId = "gbox_title", label = "Title: ", value = "title"), textInput(inputId = "gbox_xlabel", label = "X Axes Label: ", value = "label"), selectInput('gbox_notch', 'Notch', choices = c("TRUE" = TRUE, "FALSE" = FALSE), selected = "FALSE") ), column(2, selectInput('gbox_horiz', 'Horizontal', choices = c("TRUE" = TRUE, "FALSE" = FALSE), selected = "FALSE"), textInput(inputId = "gbox_col", label = "Border Color: ", value = "black"), textInput(inputId = "gbox_subtitle", label = "Subtitle: ", value = "subtitle"), textInput(inputId = "gbox_ylabel", label = "Y Axes Label: ", value = "label") ), column(8, plotOutput('gbox_plot_1', height = '600px') ) ), br(), br(), br() ), tabPanel('Outliers', column(4, fluidRow( h3('Outliers'), column(6, textInput(inputId = "gbox_ofill", label = "Fill: ", value = "blue"), numericInput(inputId = 'gbox_oshape', label = 'Shape', value = 22, min = 0, step = 1, max = 25 ), numericInput(inputId = 'gbox_oalpha', label = 'Alpha', value = 0.8, min = 0, step = 0.1, max = 1 ) ), column(6, textInput(inputId = "gbox_ocol", label = "Color: ", value = "black"), numericInput(inputId = 'gbox_osize', label = 'Size', value = 2, min = 0, step = 0.1 ) ) ) ), column(8, plotOutput('gbox_plot_2', height = '600px') ) ), tabPanel('Jitter', column(4, fluidRow( h3('Jitter'), column(6, selectInput('gbox_jitter', 'Jitter', choices = c("TRUE" = TRUE, "FALSE" = FALSE), selected = "FALSE"), numericInput(inputId = 'gbox_jwidth', label = 'Width', value = 0.1, min = 0, step = 0.1), textInput(inputId = "gbox_jfill", label = "Fill: ", value = "blue"), numericInput(inputId = 'gbox_jshape', label = 'Shape', value = 22, min = 0, step = 1, max = 25 ) ), column(6, numericInput(inputId = 'gbox_jalpha', label = 'Alpha', value = 0.8, min = 0, step = 0.1, max = 1 ), numericInput(inputId = 'gbox_jheight', label = 'Height', value = 0.1, min = 0, step = 0.1 ), textInput(inputId = "gbox_jcol", label = "Color: ", value = "black"), numericInput(inputId = 'gbox_jsize', label = 'Size', value = 2, min = 0, step = 0.1 ) ) ) ), column(8, plotOutput('gbox_plot_3', height = '600px') ) ), tabPanel('Axis Range', fluidRow( column(2, uiOutput('ui_gboxyrange_min'), selectInput('gbox_remx', 'Remove X Axis Label', choices = c("TRUE" = TRUE, "FALSE" = FALSE), selected = "FALSE") ), column(2, uiOutput('ui_gboxyrange_max'), selectInput('gbox_remy', 'Remove Y Axis Label', choices = c("TRUE" = TRUE, "FALSE" = FALSE), selected = "FALSE") ), column(8, plotOutput('gbox_plot_4', height = '600px') ) ) ), tabPanel('Annotations', fluidRow( column(2, selectInput('gbox_text', 'Add Text', choices = c("TRUE" = TRUE, "FALSE" = FALSE), selected = "FALSE"), numericInput( inputId = "gbox_text_x_loc", label = "X Intercept: ", value = 1, step = 1), numericInput( inputId = "gbox_text_y_loc", label = "Y Intercept: ", value = 1, step = 1 ) ), column(2, textInput(inputId = "gbox_plottext", label = "Text:", value = ""), textInput( inputId = "gbox_textcolor", label = "Text Color: ", value = "black" ), numericInput( inputId = "gbox_textsize", label = "Text Size: ", value = 10, min = 1, step = 1 ) ), column(8, plotOutput('gbox_plot_5', height = '600px') ) ) ), tabPanel('Others', column(4, tabsetPanel(type = 'tabs', tabPanel('Color', fluidRow( column(6, textInput(inputId = "gbox_title_col", label = "Title:", value = "black"), textInput(inputId = "gbox_sub_col", label = "Subtitle:", value = "black"), textInput(inputId = "gbox_xlab_col", label = "X Axis Label:", value = "black"), textInput(inputId = "gbox_ylab_col", label = "Y Axis Label:", value = "black") ) ) ), tabPanel('Font Family', fluidRow( column(6, textInput(inputId = "gbox_title_fam", label = "Title:", value = "Times"), textInput(inputId = "gbox_sub_fam", label = "Subtitle:", value = "Times"), textInput(inputId = "gbox_xlab_fam", label = "X Axis Label:", value = "Times"), textInput(inputId = "gbox_ylab_fam", label = "Y Axis Label:", value = "Times") ) ) ), tabPanel('Font Face', fluidRow( column(6, selectInput('gbox_title_font', 'Title:', choices = c(plain = 'plain', bold = 'bold', italic = 'italic', bold_italic = 'bold.italic'), selected = "plain"), selectInput('gbox_subtitle_font', 'Subtitle:', choices = c(plain = 'plain', bold = 'bold', italic = 'italic', bold_italic = 'bold.italic'), selected = "plain"), selectInput('gbox_xlab_font', 'X Axis Label:', choices = c(plain = 'plain', bold = 'bold', italic = 'italic', bold_italic = 'bold.italic'), selected = "plain"), selectInput('gbox_ylab_font', 'Y Axis Label:', choices = c(plain = 'plain', bold = 'bold', italic = 'italic', bold_italic = 'bold.italic'), selected = "plain") ) ) ), tabPanel('Font Size', fluidRow( column(6, numericInput(inputId = "gbox_title_size", label = "Title:", min = 1, step = 0.1, value = 1), numericInput(inputId = "gbox_sub_size", label = "Subtitle:", min = 1, step = 0.1, value = 1), numericInput(inputId = "gbox_xlab_size", label = "X Axis Label:", min = 1, step = 0.1, value = 1), numericInput(inputId = "gbox_ylab_size", label = "Y Axis Label:", min = 1, step = 0.1, value = 1) ) ) ), tabPanel('Horizontal', fluidRow( column(6, numericInput(inputId = "gbox_title_hjust", label = "Title:", min = 0, step = 0.1, value = 0.5, max = 1), numericInput(inputId = "gbox_sub_hjust", label = "Subtitle:", min = 0, step = 0.1, value = 0.5, max = 1), numericInput(inputId = "gbox_xlab_hjust", label = "X Axis Label:", min = 0, step = 0.1, value = 0.5, max = 1), numericInput(inputId = "gbox_ylab_hjust", label = "Y Axis Label:", min = 0, step = 0.1, value = 0.5, max = 1) ) ) ), tabPanel('Vertical', fluidRow( column(6, numericInput(inputId = "gbox_title_vjust", label = "Title:", min = 0, step = 0.1, value = 0.5, max = 1), numericInput(inputId = "gbox_sub_vjust", label = "Subtitle:", min = 0, step = 0.1, value = 0.5, max = 1), numericInput(inputId = "gbox_xlab_vjust", label = "X Axis Label:", min = 0, step = 0.1, value = 0.5, max = 1), numericInput(inputId = "gbox_ylab_vjust", label = "Y Axis Label:", min = 0, step = 0.1, value = 0.5, max = 1) ) ) ) ) ), column(8, plotOutput('gbox_plot_6', height = '600px') ) ), tabPanel('Theme', column(2, selectInput(inputId = 'gbox_theme', label = 'Theme', choices = list("Classic Dark", "Default", "Light", "Minimal", "Dark", "Classic", "Empty"), selected = "Default") ), column(2), column(8, align = 'center', plotOutput('gbox_plot_7', height = '600px') ) ), tabPanel('Plot', column(12, align = 'center', plotOutput('gbox_plot_8', height = '600px') ) ) ) ) ) ) )
/scratch/gouwar.j/cran-all/cranData/xplorerr/inst/app-visualize/ui/ui_gbox.R
tabPanel('2 Factor Box Plot', value = 'tab_gbox2', fluidPage( fluidRow( column(12, align = 'left', h4('Box Plot') ) ), hr(), fluidRow( column(12, tabsetPanel(type = 'tabs', tabPanel('Variables', fluidRow( column(2, selectInput('gbox2_select_x', 'Variable 1: ', choices = "", selected = ""), selectInput('gbox2_notch', 'Notch', choices = c("TRUE" = TRUE, "FALSE" = FALSE), selected = "FALSE"), textInput(inputId = "gbox2_fill", label = "Bar Color: ", value = "blue"), textInput(inputId = "gbox2_title", label = "Title: ", value = "title"), textInput(inputId = "gbox2_xlabel", label = "X Axes Label: ", value = "label") ), column(2, selectInput('gbox2_select_y', 'Variable 2: ', choices = "", selected = ""), selectInput('gbox2_horiz', 'Horizontal', choices = c("TRUE" = TRUE, "FALSE" = FALSE), selected = "FALSE"), textInput(inputId = "gbox2_col", label = "Border Color: ", value = "black"), textInput(inputId = "gbox2_subtitle", label = "Subtitle: ", value = "subtitle"), textInput(inputId = "gbox2_ylabel", label = "Y Axes Label: ", value = "label") ), column(8, plotOutput('gbox2_plot_1', height = '600px') ) ) ), tabPanel('Outliers', column(4, fluidRow( h3('Outliers'), column(6, textInput(inputId = "gbox2_ofill", label = "Fill: ", value = "blue"), numericInput(inputId = 'gbox2_oshape', label = 'Shape', value = 22, min = 0, step = 1, max = 25 ), numericInput(inputId = 'gbox2_oalpha', label = 'Alpha', value = 0.8, min = 0, step = 0.1, max = 1 ) ), column(6, textInput(inputId = "gbox2_ocol", label = "Color: ", value = "black"), numericInput(inputId = 'gbox2_osize', label = 'Size', value = 2, min = 0, step = 0.1 ) ) ) ), column(8, plotOutput('gbox2_plot_2', height = '600px') ) ), tabPanel('Jitter', column(4, fluidRow( h3('Jitter'), column(6, selectInput('gbox2_jitter', 'Jitter', choices = c("TRUE" = TRUE, "FALSE" = FALSE), selected = "FALSE"), numericInput(inputId = 'gbox2_jwidth', label = 'Width', value = 0.1, min = 0, step = 0.1), textInput(inputId = "gbox2_jfill", label = "Fill: ", value = "blue"), numericInput(inputId = 'gbox2_jshape', label = 'Shape', value = 22, min = 0, step = 1, max = 25 ) ), column(6, numericInput(inputId = 'gbox2_jalpha', label = 'Alpha', value = 0.8, min = 0, step = 0.1, max = 1 ), numericInput(inputId = 'gbox2_jheight', label = 'Height', value = 0.1, min = 0, step = 0.1 ), textInput(inputId = "gbox2_jcol", label = "Color: ", value = "black"), numericInput(inputId = 'gbox2_jsize', label = 'Size', value = 2, min = 0, step = 0.1 ) ) ) ), column(8, plotOutput('gbox2_plot_3', height = '600px') ) ), tabPanel('Axis Range', fluidRow( column(2, uiOutput('ui_gbox2yrange_min'), selectInput('gbox2_remx', 'Remove X Axis Label', choices = c("TRUE" = TRUE, "FALSE" = FALSE), selected = "FALSE") ), column(2, uiOutput('ui_gbox2yrange_max'), selectInput('gbox2_remy', 'Remove Y Axis Label', choices = c("TRUE" = TRUE, "FALSE" = FALSE), selected = "FALSE") ), column(8, plotOutput('gbox2_plot_4', height = '600px') ) ) ), tabPanel('Annotations', fluidRow( column(2, selectInput('gbox2_text', 'Add Text', choices = c("TRUE" = TRUE, "FALSE" = FALSE), selected = "FALSE"), numericInput( inputId = "gbox2_text_x_loc", label = "X Intercept: ", value = 1, step = 1), numericInput( inputId = "gbox2_text_y_loc", label = "Y Intercept: ", value = 1, step = 1 ) ), column(2, textInput(inputId = "gbox2_plottext", label = "Text:", value = ""), textInput( inputId = "gbox2_textcolor", label = "Text Color: ", value = "black" ), numericInput( inputId = "gbox2_textsize", label = "Text Size: ", value = 10, min = 1, step = 1 ) ), column(8, plotOutput('gbox2_plot_5', height = '600px') ) ) ), tabPanel('Others', column(4, tabsetPanel(type = 'tabs', tabPanel('Color', fluidRow( column(6, textInput(inputId = "gbox2_title_col", label = "Title:", value = "black"), textInput(inputId = "gbox2_sub_col", label = "Subtitle:", value = "black"), textInput(inputId = "gbox2_xlab_col", label = "X Axis Label:", value = "black"), textInput(inputId = "gbox2_ylab_col", label = "Y Axis Label:", value = "black") ) ) ), tabPanel('Font Family', fluidRow( column(6, textInput(inputId = "gbox2_title_fam", label = "Title:", value = "Times"), textInput(inputId = "gbox2_sub_fam", label = "Subtitle:", value = "Times"), textInput(inputId = "gbox2_xlab_fam", label = "X Axis Label:", value = "Times"), textInput(inputId = "gbox2_ylab_fam", label = "Y Axis Label:", value = "Times") ) ) ), tabPanel('Font Face', fluidRow( column(6, selectInput('gbox2_title_font', 'Title:', choices = c(plain = 'plain', bold = 'bold', italic = 'italic', bold_italic = 'bold.italic'), selected = "plain"), selectInput('gbox2_subtitle_font', 'Subtitle:', choices = c(plain = 'plain', bold = 'bold', italic = 'italic', bold_italic = 'bold.italic'), selected = "plain"), selectInput('gbox2_xlab_font', 'X Axis Label:', choices = c(plain = 'plain', bold = 'bold', italic = 'italic', bold_italic = 'bold.italic'), selected = "plain"), selectInput('gbox2_ylab_font', 'Y Axis Label:', choices = c(plain = 'plain', bold = 'bold', italic = 'italic', bold_italic = 'bold.italic'), selected = "plain") ) ) ), tabPanel('Font Size', fluidRow( column(6, numericInput(inputId = "gbox2_title_size", label = "Title:", min = 1, step = 0.1, value = 1), numericInput(inputId = "gbox2_sub_size", label = "Subtitle:", min = 1, step = 0.1, value = 1), numericInput(inputId = "gbox2_xlab_size", label = "X Axis Label:", min = 1, step = 0.1, value = 1), numericInput(inputId = "gbox2_ylab_size", label = "Y Axis Label:", min = 1, step = 0.1, value = 1) ) ) ), tabPanel('Horizontal', fluidRow( column(6, numericInput(inputId = "gbox2_title_hjust", label = "Title:", min = 0, step = 0.1, value = 0.5, max = 1), numericInput(inputId = "gbox2_sub_hjust", label = "Subtitle:", min = 0, step = 0.1, value = 0.5, max = 1), numericInput(inputId = "gbox2_xlab_hjust", label = "X Axis Label:", min = 0, step = 0.1, value = 0.5, max = 1), numericInput(inputId = "gbox2_ylab_hjust", label = "Y Axis Label:", min = 0, step = 0.1, value = 0.5, max = 1) ) ) ), tabPanel('Vertical', fluidRow( column(6, numericInput(inputId = "gbox2_title_vjust", label = "Title:", min = 0, step = 0.1, value = 0.5, max = 1), numericInput(inputId = "gbox2_sub_vjust", label = "Subtitle:", min = 0, step = 0.1, value = 0.5, max = 1), numericInput(inputId = "gbox2_xlab_vjust", label = "X Axis Label:", min = 0, step = 0.1, value = 0.5, max = 1), numericInput(inputId = "gbox2_ylab_vjust", label = "Y Axis Label:", min = 0, step = 0.1, value = 0.5, max = 1) ) ) ) ) ), column(8, plotOutput('gbox2_plot_6', height = '600px') ) ), tabPanel('Theme', column(2, selectInput(inputId = 'gbox2_theme', label = 'Theme', choices = list("Classic Dark", "Default", "Light", "Minimal", "Dark", "Classic", "Empty"), selected = "Default") ), column(2), column(8, align = 'center', plotOutput('gbox2_plot_7', height = '600px') ) ), tabPanel('Plot', column(12, align = 'center', plotOutput('gbox2_plot_8', height = '600px') ) ) ) ) ) ) )
/scratch/gouwar.j/cran-all/cranData/xplorerr/inst/app-visualize/ui/ui_gbox2.R
tabPanel('ggplot2', value = 'tab_gg', icon = icon('area-chart'), navlistPanel(id = 'navlist_gg', well = FALSE, widths = c(2, 10), source('ui/ui_gbar.R', local = TRUE)[[1]], source('ui/ui_gbar2.R', local = TRUE)[[1]], source('ui/ui_gbox.R', local = TRUE)[[1]], source('ui/ui_gbox2.R', local = TRUE)[[1]], source('ui/ui_ghist.R', local = TRUE)[[1]], source('ui/ui_gscatter.R', local = TRUE)[[1]], source('ui/ui_gpie.R', local = TRUE)[[1]], source('ui/ui_gline.R', local = TRUE)[[1]], source('ui/ui_gline2.R', local = TRUE)[[1]] ) )
/scratch/gouwar.j/cran-all/cranData/xplorerr/inst/app-visualize/ui/ui_ggplot.R
tabPanel('Histogram', value = 'tab_ghist', fluidPage( fluidRow( column(12, align = 'left', h4('Histogram') ) ), hr(), fluidRow( column(12, tabsetPanel(type = 'tabs', tabPanel('Variables', fluidRow( column(2, selectInput('ghist_select_x', 'Variable: ', choices = "", selected = ""), textInput(inputId = "ghist_fill", label = "Bar Color: ", value = "blue"), textInput(inputId = "ghist_title", label = "Title: ", value = "title"), textInput(inputId = "ghist_xlabel", label = "X Axes Label: ", value = "label") ), column(2, numericInput('ghist_bins', 'Bins', value = 5, min = 1, step = 1), textInput(inputId = "ghist_col", label = "Border Color: ", value = "black"), textInput(inputId = "ghist_subtitle", label = "Subtitle: ", value = "subtitle"), textInput(inputId = "ghist_ylabel", label = "Y Axes Label: ", value = "label") ), column(8, plotOutput('ghist_plot_1', height = '600px') ) ) ), tabPanel('Axis Range', fluidRow( column(2, selectInput('ghist_remx', 'Remove X Axis Label', choices = c("TRUE" = TRUE, "FALSE" = FALSE), selected = "FALSE") ), column(2, selectInput('ghist_remy', 'Remove Y Axis Label', choices = c("TRUE" = TRUE, "FALSE" = FALSE), selected = "FALSE") ), column(8, plotOutput('ghist_plot_2', height = '600px') ) ) ), tabPanel('Annotations', fluidRow( column(2, selectInput('ghist_text', 'Add Text', choices = c("TRUE" = TRUE, "FALSE" = FALSE), selected = "FALSE"), numericInput( inputId = "ghist_text_x_loc", label = "X Intercept: ", value = 1, step = 1), numericInput( inputId = "ghist_text_y_loc", label = "Y Intercept: ", value = 1, step = 1 ) ), column(2, textInput(inputId = "ghist_plottext", label = "Text:", value = ""), textInput( inputId = "ghist_textcolor", label = "Text Color: ", value = "black" ), numericInput( inputId = "ghist_textsize", label = "Text Size: ", value = 10, min = 1, step = 1 ) ), column(8, plotOutput('ghist_plot_3', height = '600px') ) ) ), tabPanel('Others', column(4, tabsetPanel(type = 'tabs', tabPanel('Color', fluidRow( column(6, textInput(inputId = "ghist_title_col", label = "Title:", value = "black"), textInput(inputId = "ghist_sub_col", label = "Subtitle:", value = "black"), textInput(inputId = "ghist_xlab_col", label = "X Axis Label:", value = "black"), textInput(inputId = "ghist_ylab_col", label = "Y Axis Label:", value = "black") ) ) ), tabPanel('Font Family', fluidRow( column(6, textInput(inputId = "ghist_title_fam", label = "Title:", value = "Times"), textInput(inputId = "ghist_sub_fam", label = "Subtitle:", value = "Times"), textInput(inputId = "ghist_xlab_fam", label = "X Axis Label:", value = "Times"), textInput(inputId = "ghist_ylab_fam", label = "Y Axis Label:", value = "Times") ) ) ), tabPanel('Font Face', fluidRow( column(6, selectInput('ghist_title_font', 'Title:', choices = c(plain = 'plain', bold = 'bold', italic = 'italic', bold_italic = 'bold.italic'), selected = "plain"), selectInput('ghist_subtitle_font', 'Subtitle:', choices = c(plain = 'plain', bold = 'bold', italic = 'italic', bold_italic = 'bold.italic'), selected = "plain"), selectInput('ghist_xlab_font', 'X Axis Label:', choices = c(plain = 'plain', bold = 'bold', italic = 'italic', bold_italic = 'bold.italic'), selected = "plain"), selectInput('ghist_ylab_font', 'Y Axis Label:', choices = c(plain = 'plain', bold = 'bold', italic = 'italic', bold_italic = 'bold.italic'), selected = "plain") ) ) ), tabPanel('Font Size', fluidRow( column(6, numericInput(inputId = "ghist_title_size", label = "Title:", min = 1, step = 0.1, value = 1), numericInput(inputId = "ghist_sub_size", label = "Subtitle:", min = 1, step = 0.1, value = 1), numericInput(inputId = "ghist_xlab_size", label = "X Axis Label:", min = 1, step = 0.1, value = 1), numericInput(inputId = "ghist_ylab_size", label = "Y Axis Label:", min = 1, step = 0.1, value = 1) ) ) ), tabPanel('Horizontal', fluidRow( column(6, numericInput(inputId = "ghist_title_hjust", label = "Title:", min = 0, step = 0.1, value = 0.5, max = 1), numericInput(inputId = "ghist_sub_hjust", label = "Subtitle:", min = 0, step = 0.1, value = 0.5, max = 1), numericInput(inputId = "ghist_xlab_hjust", label = "X Axis Label:", min = 0, step = 0.1, value = 0.5, max = 1), numericInput(inputId = "ghist_ylab_hjust", label = "Y Axis Label:", min = 0, step = 0.1, value = 0.5, max = 1) ) ) ), tabPanel('Vertical', fluidRow( column(6, numericInput(inputId = "ghist_title_vjust", label = "Title:", min = 0, step = 0.1, value = 0.5, max = 1), numericInput(inputId = "ghist_sub_vjust", label = "Subtitle:", min = 0, step = 0.1, value = 0.5, max = 1), numericInput(inputId = "ghist_xlab_vjust", label = "X Axis Label:", min = 0, step = 0.1, value = 0.5, max = 1), numericInput(inputId = "ghist_ylab_vjust", label = "Y Axis Label:", min = 0, step = 0.1, value = 0.5, max = 1) ) ) ) ) ), column(8, plotOutput('ghist_plot_4', height = '600px') ) ), tabPanel('Theme', column(2, selectInput(inputId = 'ghist_theme', label = 'Theme', choices = list("Classic Dark", "Default", "Light", "Minimal", "Dark", "Classic", "Empty"), selected = "Default") ), column(2), column(8, align = 'center', plotOutput('ghist_plot_5', height = '600px') ) ), tabPanel('Plot', column(12, align = 'center', plotOutput('ghist_plot_6', height = '600px') ) ) ) ) ) ) )
/scratch/gouwar.j/cran-all/cranData/xplorerr/inst/app-visualize/ui/ui_ghist.R
tabPanel('Line Chart - I', value = 'tab_gline1', fluidPage( fluidRow( column(12, align = 'left', h4('Line Plot') ) ), hr(), fluidRow( column(12, tabsetPanel(type = 'tabs', tabPanel('Variables', fluidRow( column(2, selectInput('gline_select_x', 'Variable: ', choices = "", selected = ""), textInput(inputId = "gline_title", label = "Title: ", value = "title"), textInput(inputId = "gline_xlabel", label = "X Axes Label: ", value = "label") ), column(2, selectInput('gline_y', 'Columns: ', choices = "", selected = "", selectize = TRUE, multiple = TRUE), textInput(inputId = "gline_subtitle", label = "Subtitle: ", value = "subtitle"), textInput(inputId = "gline_ylabel", label = "Y Axes Label: ", value = "label") ), column(8, plotOutput('gline_plot_1', height = '600px') ) ) ), # tabPanel('Aesthetics', # fluidRow( # column(4, # column(6, # textInput(inputId = 'gline_col', label = 'Color: ', # value = 'black'), # textInput(inputId = 'gline_alpha', label = 'Alpha: ', # value = '1') # ), # column(6, # textInput(inputId = 'gline_ltype', label = 'Line Type: ', # value = '1'), # textInput(inputId = 'gline_lsize', label = 'Line Size: ', # value = '1') # ), # column(12, align = 'center', # actionButton(inputId = 'gline2_submit', label = 'Submit') # ) # ), # column(8, # plotOutput('gline_plot_2', height = '600px') # ) # ) # ), tabPanel('Axis Range', fluidRow( column(2, uiOutput('ui_glineyrange_min'), selectInput('gline_remx', 'Remove X Axis Label', choices = c("TRUE" = TRUE, "FALSE" = FALSE), selected = "FALSE") ), column(2, uiOutput('ui_glineyrange_max'), selectInput('gline_remy', 'Remove Y Axis Label', choices = c("TRUE" = TRUE, "FALSE" = FALSE), selected = "FALSE") ), column(8, plotOutput('gline_plot_3', height = '600px') ) ) ), tabPanel('Annotations', fluidRow( column(2, selectInput('gline_text', 'Add Text', choices = c("TRUE" = TRUE, "FALSE" = FALSE), selected = "FALSE"), numericInput( inputId = "gline_text_x_loc", label = "X Intercept: ", value = 1, step = 1), numericInput( inputId = "gline_text_y_loc", label = "Y Intercept: ", value = 1, step = 1 ) ), column(2, textInput(inputId = "gline_plottext", label = "Text:", value = ""), textInput( inputId = "gline_textcolor", label = "Text Color: ", value = "black" ), numericInput( inputId = "gline_textsize", label = "Text Size: ", value = 10, min = 1, step = 1 ) ), column(8, plotOutput('gline_plot_4', height = '600px') ) ) ), tabPanel('Others', column(4, tabsetPanel(type = 'tabs', tabPanel('Color', fluidRow( column(6, textInput(inputId = "gline_title_col", label = "Title:", value = "black"), textInput(inputId = "gline_sub_col", label = "Subtitle:", value = "black"), textInput(inputId = "gline_xlab_col", label = "X Axis Label:", value = "black"), textInput(inputId = "gline_ylab_col", label = "Y Axis Label:", value = "black") ) ) ), tabPanel('Font Family', fluidRow( column(6, textInput(inputId = "gline_title_fam", label = "Title:", value = "Times"), textInput(inputId = "gline_sub_fam", label = "Subtitle:", value = "Times"), textInput(inputId = "gline_xlab_fam", label = "X Axis Label:", value = "Times"), textInput(inputId = "gline_ylab_fam", label = "Y Axis Label:", value = "Times") ) ) ), tabPanel('Font Face', fluidRow( column(6, selectInput('gline_title_font', 'Title:', choices = c(plain = 'plain', bold = 'bold', italic = 'italic', bold_italic = 'bold.italic'), selected = "plain"), selectInput('gline_subtitle_font', 'Subtitle:', choices = c(plain = 'plain', bold = 'bold', italic = 'italic', bold_italic = 'bold.italic'), selected = "plain"), selectInput('gline_xlab_font', 'X Axis Label:', choices = c(plain = 'plain', bold = 'bold', italic = 'italic', bold_italic = 'bold.italic'), selected = "plain"), selectInput('gline_ylab_font', 'Y Axis Label:', choices = c(plain = 'plain', bold = 'bold', italic = 'italic', bold_italic = 'bold.italic'), selected = "plain") ) ) ), tabPanel('Font Size', fluidRow( column(6, numericInput(inputId = "gline_title_size", label = "Title:", min = 1, step = 0.1, value = 1), numericInput(inputId = "gline_sub_size", label = "Subtitle:", min = 1, step = 0.1, value = 1), numericInput(inputId = "gline_xlab_size", label = "X Axis Label:", min = 1, step = 0.1, value = 1), numericInput(inputId = "gline_ylab_size", label = "Y Axis Label:", min = 1, step = 0.1, value = 1) ) ) ), tabPanel('Horizontal', fluidRow( column(6, numericInput(inputId = "gline_title_hjust", label = "Title:", min = 0, step = 0.1, value = 0.5, max = 1), numericInput(inputId = "gline_sub_hjust", label = "Subtitle:", min = 0, step = 0.1, value = 0.5, max = 1), numericInput(inputId = "gline_xlab_hjust", label = "X Axis Label:", min = 0, step = 0.1, value = 0.5, max = 1), numericInput(inputId = "gline_ylab_hjust", label = "Y Axis Label:", min = 0, step = 0.1, value = 0.5, max = 1) ) ) ), tabPanel('Vertical', fluidRow( column(6, numericInput(inputId = "gline_title_vjust", label = "Title:", min = 0, step = 0.1, value = 0.5, max = 1), numericInput(inputId = "gline_sub_vjust", label = "Subtitle:", min = 0, step = 0.1, value = 0.5, max = 1), numericInput(inputId = "gline_xlab_vjust", label = "X Axis Label:", min = 0, step = 0.1, value = 0.5, max = 1), numericInput(inputId = "gline_ylab_vjust", label = "Y Axis Label:", min = 0, step = 0.1, value = 0.5, max = 1) ) ) ) ) ), column(8, plotOutput('gline_plot_5', height = '600px') ) ), tabPanel('Theme', column(2, selectInput(inputId = 'gline_theme', label = 'Theme', choices = list("Classic Dark", "Default", "Light", "Minimal", "Dark", "Classic", "Empty"), selected = "Default") ), column(2), column(8, align = 'center', plotOutput('gline_plot_6', height = '600px') ) ), tabPanel('Plot', column(12, align = 'center', plotOutput('gline_plot_7', height = '600px') ) ) ) ) ) ) )
/scratch/gouwar.j/cran-all/cranData/xplorerr/inst/app-visualize/ui/ui_gline.R
tabPanel('Line Chart - II', value = 'tab_gline2', fluidPage( fluidRow( column(12, align = 'left', h4('Line Plot - II') ) ), hr(), fluidRow( column(12, tabsetPanel(type = 'tabs', tabPanel('Variables', fluidRow( column(2, selectInput('gline2_select_x', 'Variable: ', choices = "", selected = ""), selectInput('gline2_group', 'Group: ', choices = "", selected = ""), textInput(inputId = "gline2_title", label = "Title: ", value = "title"), textInput(inputId = "gline2_xlabel", label = "X Axes Label: ", value = "label") ), column(2, selectInput('gline2_y', 'Columns: ', choices = "", selected = ""), textInput(inputId = "gline2_subtitle", label = "Subtitle: ", value = "subtitle"), textInput(inputId = "gline2_ylabel", label = "Y Axes Label: ", value = "label") ), column(8, plotOutput('gline2_plot_1', height = '600px') ) ) ), tabPanel('Aesthetics', fluidRow( column(2, br(), column(12, actionButton('gline2_col_yes', 'Color', width = '120px') ), column(12, br(), br(), actionButton('gline2_ltype_yes', 'Line Type', width = '120px') ), column(12, br(), br(), actionButton('gline2_size_yes', 'Size', width = '120px') ) ), column(2, column(12, uiOutput('gline2_col_ui') ), column(12, uiOutput('gline2_ltype_ui') ), column(12, uiOutput('gline2_size_ui') ) ), column(8, plotOutput('gline2_plot_2', height = '600px') ) ) ), tabPanel('Axis Range', fluidRow( column(2, uiOutput('ui_gline2yrange_min'), selectInput('gline2_remx', 'Remove X Axis Label', choices = c("TRUE" = TRUE, "FALSE" = FALSE), selected = "FALSE") ), column(2, uiOutput('ui_gline2yrange_max'), selectInput('gline2_remy', 'Remove Y Axis Label', choices = c("TRUE" = TRUE, "FALSE" = FALSE), selected = "FALSE") ), column(8, plotOutput('gline2_plot_3', height = '600px') ) ) ), tabPanel('Annotations', fluidRow( column(2, selectInput('gline2_text', 'Add Text', choices = c("TRUE" = TRUE, "FALSE" = FALSE), selected = "FALSE"), numericInput( inputId = "gline2_text_x_loc", label = "X Intercept: ", value = 1, step = 1), numericInput( inputId = "gline2_text_y_loc", label = "Y Intercept: ", value = 1, step = 1 ) ), column(2, textInput(inputId = "gline2_plottext", label = "Text:", value = ""), textInput( inputId = "gline2_textcolor", label = "Text Color: ", value = "black" ), numericInput( inputId = "gline2_textsize", label = "Text Size: ", value = 10, min = 1, step = 1 ) ), column(8, plotOutput('gline2_plot_4', height = '600px') ) ) ), tabPanel('Others', column(4, tabsetPanel(type = 'tabs', tabPanel('Color', fluidRow( column(6, textInput(inputId = "gline2_title_col", label = "Title:", value = "black"), textInput(inputId = "gline2_sub_col", label = "Subtitle:", value = "black"), textInput(inputId = "gline2_xlab_col", label = "X Axis Label:", value = "black"), textInput(inputId = "gline2_ylab_col", label = "Y Axis Label:", value = "black") ) ) ), tabPanel('Font Family', fluidRow( column(6, textInput(inputId = "gline2_title_fam", label = "Title:", value = "Times"), textInput(inputId = "gline2_sub_fam", label = "Subtitle:", value = "Times"), textInput(inputId = "gline2_xlab_fam", label = "X Axis Label:", value = "Times"), textInput(inputId = "gline2_ylab_fam", label = "Y Axis Label:", value = "Times") ) ) ), tabPanel('Font Face', fluidRow( column(6, selectInput('gline2_title_font', 'Title:', choices = c(plain = 'plain', bold = 'bold', italic = 'italic', bold_italic = 'bold.italic'), selected = "plain"), selectInput('gline2_subtitle_font', 'Subtitle:', choices = c(plain = 'plain', bold = 'bold', italic = 'italic', bold_italic = 'bold.italic'), selected = "plain"), selectInput('gline2_xlab_font', 'X Axis Label:', choices = c(plain = 'plain', bold = 'bold', italic = 'italic', bold_italic = 'bold.italic'), selected = "plain"), selectInput('gline2_ylab_font', 'Y Axis Label:', choices = c(plain = 'plain', bold = 'bold', italic = 'italic', bold_italic = 'bold.italic'), selected = "plain") ) ) ), tabPanel('Font Size', fluidRow( column(6, numericInput(inputId = "gline2_title_size", label = "Title:", min = 1, step = 0.1, value = 1), numericInput(inputId = "gline2_sub_size", label = "Subtitle:", min = 1, step = 0.1, value = 1), numericInput(inputId = "gline2_xlab_size", label = "X Axis Label:", min = 1, step = 0.1, value = 1), numericInput(inputId = "gline2_ylab_size", label = "Y Axis Label:", min = 1, step = 0.1, value = 1) ) ) ), tabPanel('Horizontal', fluidRow( column(6, numericInput(inputId = "gline2_title_hjust", label = "Title:", min = 0, step = 0.1, value = 0.5, max = 1), numericInput(inputId = "gline2_sub_hjust", label = "Subtitle:", min = 0, step = 0.1, value = 0.5, max = 1), numericInput(inputId = "gline2_xlab_hjust", label = "X Axis Label:", min = 0, step = 0.1, value = 0.5, max = 1), numericInput(inputId = "gline2_ylab_hjust", label = "Y Axis Label:", min = 0, step = 0.1, value = 0.5, max = 1) ) ) ), tabPanel('Vertical', fluidRow( column(6, numericInput(inputId = "gline2_title_vjust", label = "Title:", min = 0, step = 0.1, value = 0.5, max = 1), numericInput(inputId = "gline2_sub_vjust", label = "Subtitle:", min = 0, step = 0.1, value = 0.5, max = 1), numericInput(inputId = "gline2_xlab_vjust", label = "X Axis Label:", min = 0, step = 0.1, value = 0.5, max = 1), numericInput(inputId = "gline2_ylab_vjust", label = "Y Axis Label:", min = 0, step = 0.1, value = 0.5, max = 1) ) ) ) ) ), column(8, plotOutput('gline2_plot_5', height = '600px') ) ), tabPanel('Theme', column(2, selectInput(inputId = 'gline2_theme', label = 'Theme', choices = list("Classic Dark", "Default", "Light", "Minimal", "Dark", "Classic", "Empty"), selected = "Default") ), column(2), column(8, align = 'center', plotOutput('gline2_plot_6', height = '600px') ) ), tabPanel('Plot', column(12, align = 'center', plotOutput('gline2_plot_7', height = '600px') ) ) ) ) ) ) )
/scratch/gouwar.j/cran-all/cranData/xplorerr/inst/app-visualize/ui/ui_gline2.R
tabPanel('Pie Chart', value = 'tab_gpie', fluidPage( fluidRow( column(12, align = 'left', h4('Pie Chart') ) ), hr(), fluidRow( column(12, tabsetPanel(type = 'tabs', tabPanel('Variables', fluidRow( column(2, selectInput('gpie_select_x', 'Variable: ', choices = "", selected = ""), textInput(inputId = "gpie_xlabel", label = "X Axes Label: ", value = "label") ), column(2, textInput(inputId = "gpie_title", label = "Title: ", value = "title"), textInput(inputId = "gpie_ylabel", label = "Y Axes Label: ", value = "label") ), column(8, plotOutput('gpie_plot_1', height = '600px') ) ) ) ) ) ) ) )
/scratch/gouwar.j/cran-all/cranData/xplorerr/inst/app-visualize/ui/ui_gpie.R
tabPanel('Scatter Plot', value = 'tab_gscatter', fluidPage( fluidRow( column(12, align = 'left', h4('Scatter Plot') ) ), hr(), fluidRow( column(12, tabsetPanel(type = 'tabs', tabPanel('Variables', fluidRow( column(2, selectInput('gscatter_select_x', 'X Axis Variable: ', choices = "", selected = ""), textInput(inputId = "gscatter_title", label = "Title: ", value = "title"), textInput(inputId = "gscatter_xlabel", label = "X Axes Label: ", value = "label") ), column(2, selectInput('gscatter_select_y', 'Y Axis Variable: ', choices = "", selected = ""), textInput(inputId = "gscatter_subtitle", label = "Subtitle: ", value = "subtitle"), textInput(inputId = "gscatter_ylabel", label = "Y Axes Label: ", value = "label") ), column(8, plotOutput('gscatter_plot_1', height = '600px') ) ) ), tabPanel('Aesthetics', column(6, tabsetPanel(type = 'tabs', tabPanel('Options', selectInput('geas', 'Aesthetics', choices = c(Variables = 'Use Variables', Values = 'Specify Values' ) ) ), tabPanel('Use Variables', selectInput('gaes_color', 'Color: ', choices = "", selected = ""), selectInput('gaes_shape', 'Shape: ', choices = "", selected = ""), selectInput('gaes_size', 'Size: ', choices = "", selected = "") ), tabPanel('Specify Values', textInput('gscat_color', 'Color: ', value = "black"), numericInput('gscat_shape', 'Shape: ', value = 1, min = 0, max = 25), numericInput('gscat_size', 'Size: ', value = 1, min = 0), textInput('gscat_fill', 'Fill: ', value = "black") ) ) ), column(6, plotOutput('gscatter_plot_2', height = '600px') ) ), tabPanel('Axis Range', fluidRow( column(2, uiOutput('ui_gxrange_min'), uiOutput('ui_gxrange_max') ), column(2, uiOutput('ui_gyrange_min'), uiOutput('ui_gyrange_max') ), column(8, plotOutput('gscatter_plot_3', height = '600px') ) ) ), tabPanel('Fit Line', fluidRow( column(2, selectInput('gscat_line', 'Fit Line', choices = c("TRUE" = TRUE, "FALSE" = FALSE), selected = "FALSE"), selectInput('greg_type', 'Regression Type', choices = c(Linear = 'lm', Loess = 'loess') ), selectInput('greg_se', 'Standard Error', choices = c("TRUE" = TRUE, "FALSE" = FALSE), selected = "FALSE" ) ), column(8, plotOutput('gscatter_plot_4', height = '600px') ) ) ), tabPanel('Annotations', fluidRow( column(2, selectInput('gscat_text', 'Add Text', choices = c("TRUE" = TRUE, "FALSE" = FALSE), selected = "FALSE"), numericInput( inputId = "gscatter_text_x_loc", label = "X Intercept: ", value = 1, step = 1), numericInput( inputId = "gscatter_text_y_loc", label = "Y Intercept: ", value = 1, step = 1 ) ), column(2, textInput(inputId = "gscatter_plottext", label = "Text:", value = ""), textInput( inputId = "gscatter_textcolor", label = "Text Color: ", value = "black" ), numericInput( inputId = "gscatter_textsize", label = "Text Size: ", value = 1, min = 0.1, step = 0.1 ) ), column(8, plotOutput('gscatter_plot_5', height = '600px') ) ) ), tabPanel('Others', column(4, tabsetPanel(type = 'tabs', tabPanel('Color', fluidRow( column(6, textInput(inputId = "gscat_title_col", label = "Title:", value = "black"), textInput(inputId = "gscat_sub_col", label = "Subtitle:", value = "black"), textInput(inputId = "gscat_xlab_col", label = "X Axis Label:", value = "black"), textInput(inputId = "gscat_ylab_col", label = "Y Axis Label:", value = "black") ) ) ), tabPanel('Font Family', fluidRow( column(6, textInput(inputId = "gscat_title_fam", label = "Title:", value = "Times"), textInput(inputId = "gscat_sub_fam", label = "Subtitle:", value = "Times"), textInput(inputId = "gscat_xlab_fam", label = "X Axis Label:", value = "Times"), textInput(inputId = "gscat_ylab_fam", label = "Y Axis Label:", value = "Times") ) ) ), tabPanel('Font Face', fluidRow( column(6, selectInput('gscat_title_font', 'Title:', choices = c(plain = 'plain', bold = 'bold', italic = 'italic', bold_italic = 'bold.italic'), selected = "plain"), selectInput('gscat_subtitle_font', 'Subtitle:', choices = c(plain = 'plain', bold = 'bold', italic = 'italic', bold_italic = 'bold.italic'), selected = "plain"), selectInput('gscat_xlab_font', 'X Axis Label:', choices = c(plain = 'plain', bold = 'bold', italic = 'italic', bold_italic = 'bold.italic'), selected = "plain"), selectInput('gscat_ylab_font', 'Y Axis Label:', choices = c(plain = 'plain', bold = 'bold', italic = 'italic', bold_italic = 'bold.italic'), selected = "plain") ) ) ), tabPanel('Font Size', fluidRow( column(6, numericInput(inputId = "gscat_title_size", label = "Title:", min = 1, step = 0.1, value = 1), numericInput(inputId = "gscat_sub_size", label = "Subtitle:", min = 1, step = 0.1, value = 1), numericInput(inputId = "gscat_xlab_size", label = "X Axis Label:", min = 1, step = 0.1, value = 1), numericInput(inputId = "gscat_ylab_size", label = "Y Axis Label:", min = 1, step = 0.1, value = 1) ) ) ), tabPanel('Horizontal', fluidRow( column(6, numericInput(inputId = "gscat_title_hjust", label = "Title:", min = 0, step = 0.1, value = 0.5, max = 1), numericInput(inputId = "gscat_sub_hjust", label = "Subtitle:", min = 0, step = 0.1, value = 0.5, max = 1), numericInput(inputId = "gscat_xlab_hjust", label = "X Axis Label:", min = 0, step = 0.1, value = 0.5, max = 1), numericInput(inputId = "gscat_ylab_hjust", label = "Y Axis Label:", min = 0, step = 0.1, value = 0.5, max = 1) ) ) ), tabPanel('Vertical', fluidRow( column(6, numericInput(inputId = "gscat_title_vjust", label = "Title:", min = 0, step = 0.1, value = 0.5, max = 1), numericInput(inputId = "gscat_sub_vjust", label = "Subtitle:", min = 0, step = 0.1, value = 0.5, max = 1), numericInput(inputId = "gscat_xlab_vjust", label = "X Axis Label:", min = 0, step = 0.1, value = 0.5, max = 1), numericInput(inputId = "gscat_ylab_vjust", label = "Y Axis Label:", min = 0, step = 0.1, value = 0.5, max = 1) ) ) ) ) ), column(8, plotOutput('gscatter_plot_6', height = '600px') ) ), tabPanel('Theme', column(2, selectInput(inputId = 'gscatter_theme', label = 'Theme', choices = list("Classic Dark", "Default", "Light", "Minimal", "Dark", "Classic", "Empty"), selected = "Default") ), column(2), column(8, align = 'center', plotOutput('gscatter_plot_7', height = '600px') ) ), tabPanel('Plot', column(12, align = 'center', plotOutput('gscatter_plot_8', height = '600px') ) ) ) ) ) ) )
/scratch/gouwar.j/cran-all/cranData/xplorerr/inst/app-visualize/ui/ui_gscatter.R
tabPanel('Histogram', value = 'tab_hist', fluidPage( fluidRow( column(12, align = 'left', h4('Histogram') ) ), hr(), fluidRow( column(12, tabsetPanel(type = 'tabs', # variable tabPanel('Variables', # user interface column(4, column(6, # select variable selectInput('hist_select', 'Select Variable: ', choices = "", selected = "" ), # density selectInput('hist_frequency', 'Probability', choices = c("TRUE" = TRUE, "FALSE" = FALSE), selected = "FALSE"), # X axes label textInput(inputId = "hist_xlabel", label = "X Axes Label", value = ""), # hide axes selectInput('hist_hideaxes', 'Axes: ', choices = c("TRUE" = TRUE, "FALSE" = FALSE), selected = "TRUE" ) ), column(6, # plot title textInput(inputId = "hist_title", label = "Title", value = ""), # right closed intervals selectInput('hist_interval', 'Intervals', choices = c("TRUE" = TRUE, "FALSE" = FALSE), selected = "TRUE" ), # Y axes label textInput(inputId = "hist_ylabel", label = "Y Axes Label", value = ""), # show labels selectInput('hist_showlabels', 'Labels ', choices = c(TRUE, FALSE), selected = FALSE ) ) ), # plot column(8, plotOutput('hist_1') ) ), # bins tabPanel('Bins', column(5, tabsetPanel(type = 'tabs', tabPanel('Options', selectInput('bin_opt', 'Binning Options', choices = c(Bins = 'Bins', Intervals = 'Intervals', Algorithms = 'Algorithms') ) ), tabPanel('Bins', numericInput("nbins", "Number of Bins", value = 5, min = 1) ), tabPanel('Intervals', numericInput("bin_intervals", "Number of Intervals", value = 1, min = 1), uiOutput("ui_nbin_intervals") ), tabPanel('Algorithms', selectInput('alg_options', 'Binning Algorithms', choices = c(None = 'None', Sturges = 'Sturges', Scott = 'Scott', FD = 'FD')) ) ) ), column(7, plotOutput('hist_2') ) ), tabPanel('Color & Shading', column(4, tabsetPanel(type = 'tabs', tabPanel('Histogram', column(6, numericInput("ncolhist", "Number of Colors", value = 0, min = 0)), column(6, uiOutput("ui_ncolhist")) ), tabPanel('Border', column(6, numericInput("nborhist", "Number of Border Colors", value = 0, min = 0)), column(6, uiOutput("ui_nborhist")) ) ) ), column(8, plotOutput('hist_3') ) ), tabPanel("Legend", column(4, tabsetPanel(type = 'tabs', tabPanel('General', br(), flowLayout( selectInput('hist_leg_yn', 'Create Legend', choices = c("TRUE" = TRUE, "FALSE" = FALSE), selected = "FALSE") ), br(), h4('Axis Position', align = 'left', style = 'color:black'), flowLayout( numericInput('hist_leg_x', 'X Axis:', value = 1), numericInput('hist_leg_y', 'Y Axis:', value = 1) ), br(), h4('Legend Names', align = 'left', style = 'color:black'), flowLayout( numericInput('hist_leg_names', 'Select:', value = 1, min = 1, step = 1), uiOutput('ui_hist_legnames') ), br(), h4('Points', align = 'left', style = 'color:black'), flowLayout( numericInput('hist_leg_point', 'Select:', value = 1, min = 0, max = 25, step = 1), uiOutput('ui_hist_legpoint') ) ), tabPanel('Legend Box', flowLayout( selectInput('hist_leg_boxtype', 'Box Type', choices = c('o', 'n'), selected = 'o'), textInput('hist_leg_boxcol', 'Box Color', value = 'white'), numericInput('hist_leg_boxlty', 'Box Border Line', value = 1, min = 1, max = 6, step = 1), numericInput('hist_leg_boxlwd', 'Box Border Width', value = 1, min = 0, step = 0.1), textInput('hist_leg_boxborcol', 'Box Border Color', value = 'black'), numericInput('hist_leg_boxxjust', 'Horizontal Justification', value = 0, min = 0, max = 1), numericInput('hist_leg_boxyjust', 'Vertical Justification', value = 1, min = 0, max = 1) ) ), tabPanel('Legend Text', flowLayout( selectInput('hist_leg_texthoriz', 'Horizontal Text', choices = c(TRUE, FALSE), selected = FALSE), textInput('hist_leg_textcol', 'Text Color', value = 'black'), textInput('hist_leg_title', 'Title', value = ''), numericInput('hist_leg_textfont', 'Text Font', value = 1, min = 1, max = 5, step = 1), numericInput('hist_leg_textcolumns', 'Columns', value = 1, min = 0, step = 1), textInput('hist_leg_titlecol', 'Title Color', value = 'black'), numericInput('hist_leg_textadj', 'Text Horizontal Adj', value = 0.5, min = 0, max = 1, step = 0.1) ) ) ) ), column(8, plotOutput('hist_4', height = '400px') ) ), tabPanel('Text', column(4, tabsetPanel(type = 'tabs', tabPanel('Text (Inside Plot)', flowLayout( # x axis location numericInput( inputId = "hist_text_x_loc", label = "X Intercept: ", value = 1, step = 1 ), # y axis location numericInput( inputId = "hist_text_y_loc", label = "Y Intercept: ", value = 1, step = 1 ), # text textInput(inputId = "hist_plottext", label = "Text:", value = ""), # text font numericInput( inputId = "hist_textfont", label = "Text Font: ", value = 1, min = 1, max = 5, step = 1 ), # text color textInput( inputId = "hist_textcolor", label = "Text Color: ", value = "black" ), # text size numericInput( inputId = "hist_textsize", label = "Text Size: ", value = 1, min = 0.1, step = 0.1 ) ) ), tabPanel('Marginal Text', flowLayout( # text textInput(inputId = "hist_mtextplot", label = "Text:", value = ""), # text side numericInput( inputId = "hist_mtext_side", label = "Side: ", value = 1, min = 1, max = 4, step = 1 ), # text line numericInput( inputId = "hist_mtext_line", label = "Line: ", value = 1, step = 1 ), # text adjustment numericInput( inputId = "hist_mtextadj", label = "Adj: ", value = 0.5, min = 0, max = 1, step = 0.1 ), # text font numericInput( inputId = "hist_mtextfont", label = "Text Font: ", value = 1, min = 1, max = 5, step = 1 ), # text color textInput( inputId = "hist_mtextcolor", label = "Text Color: ", value = "black" ), # text size numericInput( inputId = "hist_mtextsize", label = "Text Size: ", value = 1, min = 0.1, step = 0.1 ) ) ) ) ), column(8, plotOutput('hist_5') ) ), tabPanel('Others', column(6, tabsetPanel(type = 'tabs', tabPanel('Color', flowLayout( textInput('hist_colaxis', 'Axis Color: ', 'black'), textInput('hist_coltitle', 'Title Color: ', 'black'), textInput('hist_collabel', 'Label Color: ', 'black'), textInput('hist_colsub', 'Subtitle Color: ', 'black') ) ), tabPanel('Size', flowLayout( numericInput('hist_cexmain', 'Title Size: ', value = 1, min = 0.1, step = 0.1 ), numericInput('hist_cexsub', 'Subtitle Size: ', value = 1, min = 0.1, step = 0.1 ), numericInput('hist_cexaxis', 'Axis Size: ', value = 1, min = 0.1, step = 0.1 ), numericInput('hist_cexlab', 'Label Size: ', value = 1, min = 0.1, step = 0.1 ) ) ), tabPanel('Font', flowLayout( numericInput('hist_fontmain', 'Title Font', value = 1, min = 1, max = 5, step = 1 ), numericInput('hist_fontsub', 'Subtitle Font', value = 1, min = 1, max = 5, step = 1 ), numericInput('hist_fontaxis', 'Axis Font', value = 1, min = 1, max = 5, step = 1 ), numericInput('hist_fontlab', 'Label Font', value = 1, min = 1, max = 5, step = 1 ) ) ) ) ), column(6, plotOutput('hist_6') ) ), # plot tabPanel('Plot', fluidRow( column(8, offset = 2, plotOutput('hist_final') ) ) ) ) ) ) ) )
/scratch/gouwar.j/cran-all/cranData/xplorerr/inst/app-visualize/ui/ui_hist.R
tabPanel('Histogram', value = 'tab_hist_prh', fluidPage( fluidRow( column(12, align = 'left', h4('Histogram') ) ), hr(), fluidRow( column(12, tabsetPanel(type = 'tabs', tabPanel('plotly', fluidRow( column(2, selectInput('histly_select_x', 'Variable 1: ', choices = "", selected = ""), textInput(inputId = "histly_xlabel", label = "X Axes Label: ", value = "label"), selectInput('histly_horiz', 'Horizontal', choices = c("TRUE" = "h", "FALSE" = "v"), selected = "FALSE", width = '150px'), textInput(inputId = "histly_color", label = "Color: ", value = ""), selectInput('histly_auto', 'Auto Bin: ', choices = c("TRUE" = TRUE, "FALSE" = FALSE), selected = "TRUE"), numericInput(inputId = "histly_binstart", "Bin Start: ", min = 0, step = 1, value = 1) ), column(2, textInput(inputId = "histly_title", label = "Title: ", value = "title"), textInput(inputId = "histly_ylabel", label = "Y Axes Label: ", value = "label"), selectInput('histly_type', 'Type', choices = c("Count" = "count", "Density" = "density"), selected = "Count", width = '150px'), numericInput(inputId = "histly_opacity", "Opacity: ", min = 0, max = 1, step = 0.1, value = 1), numericInput(inputId = "histly_binsize", "Bin Size: ", min = 0, step = 1, value = 1), numericInput(inputId = "histly_binend", "Bin End: ", min = 0, step = 1, value = 1) ), column(8, align = 'center', plotly::plotlyOutput('histly_plot_1', height = '600px') ) ) ), tabPanel('rbokeh', fluidRow( column(2, selectInput('bohist_select_x', 'Variable 1: ', choices = "", selected = ""), textInput(inputId = "bohist_xlabel", label = "X Axes Label: ", value = "label"), numericInput(inputId = "bohist_breaks", "Breaks: ", value = 5, min = 0, step = 1), selectInput(inputId = "bohist_lowest", label = "Include Lowest: ", choices = c("TRUE" = TRUE, "FALSE" = FALSE), selected = "TRUE"), textInput(inputId = "bohist_color", label = "Color: ", value = ""), textInput(inputId = "bohist_dcolor", label = "Density Color: ", value = ""), numericInput(inputId = "bohist_dalpha", "Density Alpha: ", value = 1, min = 0, max = 1, step = 0.1) ), column(2, textInput(inputId = "bohist_title", label = "Title: ", value = "title"), textInput(inputId = "bohist_ylabel", label = "Y Axes Label: ", value = "label"), selectInput(inputId = "bohist_density", label = "Density: ", choices = c("TRUE" = TRUE, "FALSE" = FALSE), selected = "FALSE"), selectInput(inputId = "bohist_right", label = "Right: ", choices = c("TRUE" = TRUE, "FALSE" = FALSE), selected = "TRUE"), selectInput(inputId = "bohist_add", label = "Add Density Line: ", choices = c("TRUE" = TRUE, "FALSE" = FALSE), selected = "FALSE"), numericInput(inputId = "bohist_dtype", "Line Type: ", value = 1, min = 1, max = 5, step = 1), numericInput(inputId = "bohist_dwidth", "Line Width: ", value = 1, min = 1, step = 1) ), column(8, align = 'center', rbokeh::rbokehOutput('bohist_plot_1', height = '600px') ) ) ), tabPanel('highcharts', fluidRow( column(2, selectInput('hihist_select_x', 'Variable 1: ', choices = "", selected = ""), textInput(inputId = "hihist_xlabel", label = "X Axes Label: ", value = "label") ), column(2, textInput(inputId = "hihist_title", label = "Title: ", value = "title"), textInput(inputId = "hihist_color", label = "Color: ", value = "blue") ), column(8, align = 'center', highcharter::highchartOutput('hihist_plot_1', height = '600px') ) ) ) ) ) ) ) )
/scratch/gouwar.j/cran-all/cranData/xplorerr/inst/app-visualize/ui/ui_hist_prh.R
tabPanel("Home", value = "tab_analyze_home", fluidPage( fluidRow( column(12, align = 'center', h3('What do you want to do?') ) ), br(), br(), fluidRow( column(1), column(2, align = 'right', img(src = 'summary1.png', width = '100px', height = '100px') ), column(6, align = 'center', h4('Descriptive Statisics'), p('Generate descriptive/summary statistics.') ), column(2, align = 'left', br(), actionButton( inputId = 'click_descriptive', label = 'Click Here', width = '100px' ) ), column(1) ), br(), fluidRow( column(1), column(2, align = 'right', img(src = 'normal.png', width = '100px', height = '100px') ), column(6, align = 'center', h4('Statistical Distributions'), p('Explore and visualize different statistical distributions.') ), column(2, align = 'left', br(), actionButton( inputId = 'click_distributions', label = 'Click Here', width = '100px' ) ), column(1) ), br(), fluidRow( column(1), column(2, align = 'right', img(src = 'ttest3.jpg', width = '100px', height = '100px') ), column(6, align = 'center', h4('Hypothesis Testing'), p('Test hypothesis using parametric and non-parametric tests.') ), column(2, align = 'left', br(), actionButton( inputId = 'click_inference', label = 'Click Here', width = '100px' ) ), column(1) ), br(), fluidRow( column(1), column(2, align = 'right', img(src = 'simple_reg.png', width = '100px', height = '100px') ), column(6, align = 'center', h4('Model Building'), p('Tools for building simple and multiple linear regression models.') ), column(2, align = 'left', br(), actionButton( inputId = 'click_model', label = 'Click Here', width = '100px' ) ), column(1) ), br(), fluidRow( column(1), column(2, align = 'right', img(src = 'visualize2.png', width = '100px', height = '100px') ), column(6, align = 'center', h4('Data Visualization'), p('Visualize data using ggplot2, rbokeh, plotly and highcharts.') ), column(2, align = 'left', br(), actionButton( inputId = 'click_visualize', label = 'Click Here', width = '100px' ) ), column(1) ) ) )
/scratch/gouwar.j/cran-all/cranData/xplorerr/inst/app-visualize/ui/ui_home.R
tabPanel('Home', value = 'tab_home_analyze', icon = icon('home'), navlistPanel(id = 'navlist_home', well = FALSE, widths = c(2, 10), source('ui/ui_home.R', local = TRUE)[[1]], source('ui/ui_eda_home.R', local = TRUE)[[1]], source('ui/ui_dist_home.R', local = TRUE)[[1]], source('ui/ui_infer_home.R', local = TRUE)[[1]], source('ui/ui_infer1_home.R', local = TRUE)[[1]], source('ui/ui_infer2_home.R', local = TRUE)[[1]], source('ui/ui_infer3_home.R', local = TRUE)[[1]], source('ui/ui_model_home.R', local = TRUE)[[1]] ) )
/scratch/gouwar.j/cran-all/cranData/xplorerr/inst/app-visualize/ui/ui_homes.R
tabPanel('Line Graph', value = 'tab_line', fluidPage( fluidRow( column(12, align = 'left', h4('Line Chart') ) ), hr(), fluidRow( column(12, tabsetPanel(type = 'tabs', tabPanel('Variables', fluidRow( column(2, selectInput('line_select_x', 'X Axis Variable: ', choices = "", selected = ""), textInput('line_title', 'Title', value = ''), textInput('line_xlabel', 'X Axis Label', '') ), column(2, selectInput('line_select_y', 'Y Axis Variable: ', choices = "", selected = ""), textInput('line_subtitle', 'Subitle', value = ''), textInput('line_ylabel', 'Y Axis Label', '') ), column(8, plotOutput('line_plot_1') ) ) ), tabPanel('Aesthetics', column(4, tabsetPanel(type = 'tabs', tabPanel('Line', column(6, numericInput('line_width', 'Line Width', value = 1, step = 0.1), textInput('line_color', 'Color', value = 'black'), numericInput('line_type', 'Line Type', min = 1, max = 5, value = 1, step = 1) ) ), tabPanel('Points', column(6, flowLayout( selectInput('add_points', 'Add Points', choices = c("TRUE" = TRUE, "FALSE" = FALSE), selected = "FALSE"), numericInput('point_shape', 'Shape', min = 0, max = 25, value = 1), numericInput('point_size', 'Size', min = 0.5, value = 1), textInput('point_col', 'Color', 'black'), textInput('point_bg', 'Background Color', 'red') ) ) ) ) ), column(8, plotOutput('line_plot_2') ) ), tabPanel('Axis Range', column(2, uiOutput('ui_yrange_minl') ), column(2, uiOutput('ui_yrange_maxl') ), column(8, plotOutput('line_plot_3') ) ), tabPanel('Additional Lines', column(6, tabsetPanel(type = 'tabs', tabPanel('Add Lines', fluidRow( column(4, numericInput('n_lines', 'Lines', min = 0, value = 0, step = 1)) ), fluidRow( column(3, uiOutput('ui_nlines')), column(3, uiOutput('ui_ncolors')), column(3, uiOutput('ui_nltys')), column(3, uiOutput('ui_nlwds')) ) ) ) ), column(6, plotOutput('line_plot_4') ) ), tabPanel('Additional Points', column(6, tabsetPanel(type = 'tabs', tabPanel('Add Points', fluidRow( selectInput('extra_p', 'Add Points', choices = c("TRUE" = TRUE, "FALSE" = FALSE), selected = "FALSE") ), fluidRow( column(3, uiOutput('ui_pcolors')), column(3, uiOutput('ui_pbgcolor')), column(3, uiOutput('ui_psize')), column(3, uiOutput('ui_pshape')) ) ) ) ), column(6, plotOutput('line_plot_5') ) ), tabPanel('Others', column(4, tabsetPanel(type = 'tabs', tabPanel('Color', fluidRow( column(6, textInput('line_colaxis', 'Axis Color: ', 'black'), textInput('line_coltitle', 'Title Color: ', 'black') ), column(6, textInput('line_collabel', 'Label Color: ', 'black'), textInput('line_colsub', 'Subtitle Color: ', 'black') ) ) ), tabPanel('Size', fluidRow( column(6, numericInput('line_cexmain', 'Title Size: ', value = 1, min = 0.1, step = 0.1), numericInput('line_cexsub', 'Subtitle Size: ', value = 1, min = 0.1, step = 0.1) ), column(6, numericInput('line_cexaxis', 'Axis Size: ', value = 1, min = 0.1, step = 0.1), numericInput('line_cexlab', 'Label Size: ', value = 1, min = 0.1, step = 0.1) ) ) ), tabPanel('Font', fluidRow( column(6, numericInput('line_fontmain', 'Title Font', value = 1, min = 1, max = 5, step = 1), numericInput('line_fontsub', 'Subtitle Font', value = 1, min = 1, max = 5, step = 1) ), column(6, numericInput('line_fontaxis', 'Axis Font', value = 1, min = 1, max = 5, step = 1), numericInput('line_fontlab', 'Label Font', value = 1, min = 1, max = 5, step = 1) ) ) ) ) ), column(8, plotOutput('line_plot_6') ) ), tabPanel('Text', column(4, tabsetPanel(type = 'tabs', tabPanel('Text (Inside)', fluidRow( column(6, numericInput( inputId = "line_text_x_loc", label = "X Intercept: ", value = 1, step = 1), numericInput( inputId = "line_text_y_loc", label = "Y Intercept: ", value = 1, step = 1 ), textInput(inputId = "line_plottext", label = "Text:", value = "") ), column(6, numericInput( inputId = "line_textfont", label = "Text Font: ", value = 1, min = 1, max = 5, step = 1 ), numericInput( inputId = "line_textsize", label = "Text Size: ", value = 1, min = 0.1, step = 0.1 ), textInput( inputId = "line_textcolor", label = "Text Color: ", value = "black" ) ) ) ), tabPanel('Marginal Text', fluidRow( column(6, numericInput( inputId = "line_mtext_side", label = "Side: ", value = 1, min = 1, max = 4, step = 1 ), numericInput( inputId = "line_mtext_line", label = "Line: ", value = 1, step = 1 ), textInput(inputId = "line_mtextplot", label = "Text:", value = ""), numericInput( inputId = "line_mtextsize", label = "Text Size: ", value = 1, min = 0.1, step = 0.1 ) ), column(6, numericInput( inputId = "line_mtextadj", label = "Adj: ", value = 0.5, min = 0, max = 1, step = 0.1 ), numericInput( inputId = "line_mtextfont", label = "Text Font: ", value = 1, min = 1, max = 5, step = 1 ), textInput( inputId = "line_mtextcolor", label = "Text Color: ", value = "black" ) ) ) ) ) ), column(8, plotOutput('line_plot_7', height = '600px') ) ), tabPanel("Legend", column(6, tabsetPanel(type = 'tabs', tabPanel('General', br(), flowLayout( selectInput('line_leg_yn', 'Create Legend', choices = c("TRUE" = TRUE, "FALSE" = FALSE), selected = "FALSE") ), br(), h4('Axis Position', align = 'left', style = 'color:black'), flowLayout( numericInput('line_leg_x', 'X Axis:', value = 1), numericInput('line_leg_y', 'Y Axis:', value = 1) ), br(), h4('Legend Names', align = 'left', style = 'color:black'), flowLayout( numericInput('line_legnames', 'Select:', value = 0, min = 0, step = 1), uiOutput('ui_line_legnames') ), br(), h4('Lines', align = 'left', style = 'color:black'), flowLayout( numericInput('line_leg_line', 'Select:', value = 0, min = 1, max = 5, step = 1), uiOutput('ui_line_legline') ), br(), h4('Points', align = 'left', style = 'color:black'), flowLayout( numericInput('line_leg_point', 'Select:', value = 0, min = 0, max = 25, step = 1), uiOutput('ui_line_legpoint') ) ), tabPanel('Legend Box', flowLayout( selectInput('line_leg_boxtype', 'Box Type', choices = c('o', 'n'), selected = 'o'), textInput('line_leg_boxcol', 'Box Color', value = 'white'), numericInput('line_leg_boxlty', 'Box Border Line', value = 1, min = 1, max = 6, step = 1), numericInput('line_leg_boxlwd', 'Box Border Width', value = 1, min = 0, step = 0.1), textInput('line_leg_boxborcol', 'Box Border Color', value = 'black'), numericInput('line_leg_boxxjust', 'Horizontal Justification', value = 0, min = 0, max = 1), numericInput('line_leg_boxyjust', 'Vertical Justification', value = 1, min = 0, max = 1) ) ), tabPanel('Legend Text', flowLayout( selectInput('line_leg_texthoriz', 'Horizontal Text', choices = c(TRUE, FALSE), selected = FALSE), textInput('line_leg_textcol', 'Text Color', value = 'black'), textInput('line_leg_title', 'Title', value = ''), numericInput('line_leg_textfont', 'Text Font', value = 1, min = 1, max = 5, step = 1), numericInput('line_leg_textcolumns', 'Columns', value = 1, min = 0, step = 1), textInput('line_leg_titlecol', 'Title Color', value = 'black'), numericInput('line_leg_textadj', 'Text Horizontal Adj', value = 0.5, min = 0, max = 1, step = 0.1) ) ) ) ), column(6, plotOutput('line_plot_8', height = '400px') ) ), tabPanel('Plot', fluidRow( column(8, offset = 2, plotOutput('line_final') ) ) ) ) ) ) ) )
/scratch/gouwar.j/cran-all/cranData/xplorerr/inst/app-visualize/ui/ui_line.R
tabPanel('Line Chart', value = 'tab_line_prh', fluidPage( fluidRow( column(12, align = 'left', h4('Line Chart') ) ), hr(), fluidRow( column(12, tabsetPanel(type = 'tabs', tabPanel('plotly', fluidRow( column(2, selectInput('linely_select_x', 'X Axis: ', choices = "", selected = ""), textInput(inputId = "linely_xlabel", label = "X Axes Label: ", value = "label"), textInput(inputId = "linely_title", label = "Title: ", value = "title"), textInput(inputId = "linely_type", label = "Line Type: ", value = "plain") ), column(2, selectInput('linely_select_y', 'Y Axis: ', choices = "", selected = ""), textInput(inputId = "linely_ylabel", label = "Y Axes Label: ", value = "label"), textInput(inputId = "linely_color", label = "Color: ", value = "blue"), numericInput(inputId = "linely_width", label = "Width: ", min = 1, value = 1, step = 1) ), column(8, align = 'center', plotly::plotlyOutput('linely_plot_1', height = '600px') ) ) ), tabPanel('rbokeh', fluidRow( column(2, selectInput('boline_select_x', 'X Axis: ', choices = "", selected = ""), numericInput(inputId = "boline_type", label = "Line Type: ", min = 1, max = 5, value = 1, step = 1), numericInput(inputId = "boline_alpha", label = "Alpha: ", min = 0, max = 1, value = 1, step = 0.1), textInput(inputId = "boline_xlabel", label = "X Axes Label: ", value = "label"), textInput(inputId = "boline_title", label = "Title: ", value = "title") ), column(2, selectInput('boline_select_y', 'Y Axis: ', choices = "", selected = ""), textInput(inputId = "boline_color", label = "Color: ", value = "blue"), numericInput(inputId = "boline_width", label = "Line Width: ", min = 0, value = 1, step = 0.1), textInput(inputId = "boline_ylabel", label = "Y Axes Label: ", value = "label") ), column(8, align = 'center', rbokeh::rbokehOutput('boline_plot_1', height = '600px') ) ) ), tabPanel('highcharts', fluidRow( column(2, selectInput('hiline_select_x', 'Variable 1: ', choices = "", selected = ""), selectInput('hiline_labels', 'Labels', choices = c("TRUE" = TRUE, "FALSE" = FALSE), selected = "FALSE", width = '150px'), textInput(inputId = "hiline_xlabel", label = "X Axes Label: ", value = "label") ), column(2, selectInput('hiline_select_y', 'Variable 1: ', selectize = TRUE, multiple = TRUE, choices = "", selected = ""), textInput(inputId = "hiline_title", label = "Title: ", value = "title"), textInput(inputId = "hiline_ylabel", label = "Y Axes Label: ", value = "label") ), column(8, align = 'center', highcharter::highchartOutput('hiline_plot_1', height = '600px') ) ) ) ) ) ) ) )
/scratch/gouwar.j/cran-all/cranData/xplorerr/inst/app-visualize/ui/ui_line_prh.R
tabPanel('Others', value = 'tab_others', icon = icon('pie-chart'), navlistPanel(id = 'navlist_others', well = FALSE, widths = c(2, 10), source('ui/ui_bar_plot_1.R', local = TRUE)[[1]], source('ui/ui_bar_plot_2.R', local = TRUE)[[1]], source('ui/ui_box_plot_1.R', local = TRUE)[[1]], source('ui/ui_box_plot_2.R', local = TRUE)[[1]], source('ui/ui_scatter_prh.R', local = TRUE)[[1]], source('ui/ui_line_prh.R', local = TRUE)[[1]], source('ui/ui_hist_prh.R', local = TRUE)[[1]], source('ui/ui_pie_prh.R', local = TRUE)[[1]] ) )
/scratch/gouwar.j/cran-all/cranData/xplorerr/inst/app-visualize/ui/ui_others.R
tabPanel('Pie Chart', value = 'tab_pie', fluidPage( fluidRow( column(12, align = 'left', h4('Pie Chart') ) ), hr(), fluidRow( column(12, tabsetPanel(type = 'tabs', # variable selection tabPanel('Variable', # user interface column(4, column(6, # select variable selectInput('pie_select', 'Select Variable', choices = "", selected = "" ), # direction selectInput('pie_clock', 'Clockwise', choices = c("TRUE" = TRUE, "FALSE" = FALSE), selected = "FALSE" ), # edges numericInput('pie_edges', 'Edges', min = 1, step = 1, value = 200) ), column(6, # select labels selectInput('pie_label', 'Select Labels', choices = "", selected = "" ), # radius numericInput('pie_radius', 'Radius', min = 0.1, step = 0.1, value = 1), # initial angle numericInput('pie_angle', 'Initial Angle', min = 0, step = 1, value = 45) ) ), # plot column(8, plotOutput('pie_1', '500px') ) ), # pie tabPanel('Options', # user interface column(4, fluidRow( column(6, # border color textInput('pie_border', 'Border Color', value = "black"), # shading density numericInput('pie_density', 'Shading Density', min = 0, step = 1, value = NULL) ), column(6, # line type numericInput('pie_lty', 'Line Type', min = 1, max = 5, step = 1, value = 1), # shading density angle numericInput('pie_dangle', 'Angle', min = 0, step = 1, value = 45) ) ), h4('Color Options'), # dynamic ui for setting bar colors fluidRow( column(6, numericInput("ncolpie", "Number of Colors", value = 0, min = 0)), column(6, uiOutput("ui_ncolpie")) ) ), # plot column(8, plotOutput('pie_2', '500px') ) ), # variable selection tabPanel('Title', # user interface column(4, column(6, # title textInput('pie_title', 'Title', value = 'title'), # title color textInput('pie_titlecol', 'Title Color', value = 'black') ), column(6, # title font numericInput('pie_font', 'Font', min = 1, step = 1, value = 1, max = 5), # initial angle numericInput('pie_cex', 'Size', min = 0.1, step = 0.1, value = 1) ) ), # plot column(8, plotOutput('pie_3', '500px') ) ), tabPanel('Plot', fluidRow( column(8, offset = 2, plotOutput('pie_final', '600px') ) ) ) ) ) ) ) )
/scratch/gouwar.j/cran-all/cranData/xplorerr/inst/app-visualize/ui/ui_pie.R
tabPanel('3D Pie Chart', value = 'tab_pie3d', fluidPage( fluidRow( column(12, align = 'left', h4('3D Pie Chart') ) ), hr(), fluidRow( column(12, tabsetPanel(type = 'tabs', # variable selection tabPanel('Variable', # user interface column(4, column(6, # select variable selectInput('pie3_select', 'Select Variable', choices = "", selected = "" ), # radius numericInput('pie3_radius', 'Radius', min = 0.1, step = 0.1, value = 1) ), column(6, # select labels selectInput('pie3_label', 'Select Labels', choices = "", selected = "" ), # height numericInput('pie3_height', 'Height', min = 0.1, step = 0.1, value = 0.1) ) ), # plot column(8, plotOutput('pie3_1', '500px') ) ), # pie tabPanel('Options', # user interface column(4, fluidRow( column(6, # border color textInput('pie3_border', 'Border Color', value = "black"), # start numericInput('pie3_start', 'Start', min = 0, step = 1, value = 0), # explode numericInput('pie3_explode', 'Explode', min = 0, step = 0.1, value = 0), # shade numericInput('pie3_shade', 'Shade', min = 0, step = 0.1, value = 0.8), # edges numericInput('pie3_edges', 'Edges', min = 0, step = 1, value = 200) ) ) ), # plot column(8, plotOutput('pie3_2', '500px') ) ), # pie tabPanel('Color', # user interface column(4, # dynamic ui for setting bar colors fluidRow( column(6, numericInput("ncolpie3", "Number of Colors", value = 0, min = 0)), column(6, uiOutput("ui_ncolpie3")) ) ), # plot column(8, plotOutput('pie3_3', '500px') ) ), # pie tabPanel('Label', # user interface column(4, fluidRow( column(6, # label color textInput('pie3_labcol', 'Label Color', value = "black"), # label size numericInput('pie3_labcex', 'Label Size', min = 0.1, step = 0.1, value = 1.5), # label radius numericInput('pie3_labrad', 'Label Radius', min = 0.1, step = 0.01, value = 1.25) ) ), # dynamic ui for setting bar colors fluidRow( column(6, numericInput("nlabpospie3", "Number of Labels", value = 0, min = 0)), column(6, uiOutput("ui_nlabpospie3")) ) ), # plot column(8, plotOutput('pie3_4', '500px') ) ), # variable selection tabPanel('Title', # user interface column(4, column(6, # title textInput('pie3_title', 'Title', value = 'title'), # title color textInput('pie3_titlecol', 'Title Color', value = 'black') ), column(6, # title font numericInput('pie3_font', 'Font', min = 1, step = 1, value = 1, max = 5), # initial angle numericInput('pie3_cex', 'Size', min = 0.1, step = 0.1, value = 1) ) ), # plot column(8, plotOutput('pie3_5', '500px') ) ), tabPanel('Plot', fluidRow( column(8, offset = 2, plotOutput('pie3_final', '600px') ) ) ) ) ) ) ) )
/scratch/gouwar.j/cran-all/cranData/xplorerr/inst/app-visualize/ui/ui_pie3d.R
tabPanel('Pie Chart', value = 'tab_pie_prh', fluidPage( fluidRow( column(12, align = 'left', h4('Pie Chart') ) ), hr(), fluidRow( column(12, tabsetPanel(type = 'tabs', tabPanel('plotly', fluidRow( column(2, selectInput('piely_select_x', 'Variable: ', choices = "", selected = ""), textInput(inputId = "piely_xlabel", label = "X Axes Label: ", value = "label"), selectInput('piely_text_pos', 'Text Position: ', choices = c("Inside" = "inside", "Outside" = "outside"), selected = "Inside"), selectInput('piely_text_dir', 'Text Direction: ', choices = c("Anticlockwise" = "anticlockwise", "Clockwise" = "clockwise"), selected = "Anticlockwise"), numericInput(inputId = "piely_pull", "Pie Pull: ", min = 0, value = 0, max = 1, step = 0.1), textInput(inputId = "piely_color", label = "Line Color: ", value = "") ), column(2, textInput(inputId = "piely_title", label = "Title: ", value = "title"), textInput(inputId = "piely_ylabel", label = "Y Axes Label: ", value = "label"), selectInput('piely_text_info', 'Text Info: ', choices = c("Label" = "label", "Percent" = "percent", "Label & Percent" = "label+percent"), selected = "Label"), numericInput(inputId = "piely_text_rotation", "Text Rotation: ", min = 0, value = 0, max = 360, step = 1), numericInput(inputId = "piely_hole", "Pie Hole: ", min = 0, value = 0, max = 1, step = 0.1), numericInput(inputId = "piely_opacity", "Opacity: ", min = 0, value = 1, max = 1, step = 0.1) ), column(8, align = 'center', plotly::plotlyOutput('piely_plot_1', height = '600px') ) ) ), tabPanel('highcharts', fluidRow( column(2, selectInput('hipie_select_x', 'Variable: ', choices = "", selected = ""), textInput(inputId = "hipie_xlabel", label = "X Axes Label: ", value = "label") ), column(2, textInput(inputId = "hipie_title", label = "Title: ", value = "title"), textInput(inputId = "hipie_ylabel", label = "Y Axes Label: ", value = "label") ), column(8, align = 'center', highcharter::highchartOutput('hipie_plot_1', height = '600px') ) ) ) ) ) ) ) )
/scratch/gouwar.j/cran-all/cranData/xplorerr/inst/app-visualize/ui/ui_pie_prh.R
tabPanel('Scatter Plot', value = 'tab_scatter', fluidPage( fluidRow( column(12, align = 'left', h4('Scatter Plot') ) ), hr(), fluidRow( column(12, tabsetPanel(type = 'tabs', tabPanel('Variables', fluidRow( column(2, selectInput('scatter_select_x', 'X Axis Variable: ', choices = "", selected = ""), numericInput("scatter_shape", label = "Shape: ", min = 1, max = 25, step = 1, value = 1), textInput("scatter_colors", label = "Color: ", value = "black"), textInput(inputId = "scatter_title", label = "Title: ", value = "title"), textInput(inputId = "scatter_xlabel", label = "X Axes Label: ", value = "label") ), column(2, selectInput("scatter_select_y", label = "Y Axis Variable:", choices = "", selected = ""), numericInput("scatter_size1", label = "Size: ", min = 0, max = NA, step = 0.1, value = 1), textInput("scatter_fill", label = "Fill: ", value = "black"), textInput(inputId = "scatter_subtitle", label = "Subtitle: ", value = "subtitle"), textInput(inputId = "scatter_ylabel", label = "Y Axes Label: ", value = "label") ), column(8, plotOutput('scatter_plot_1', height = '600px') ) ) ), tabPanel('Axis Range', fluidRow( column(2, uiOutput('ui_xrange_min'), uiOutput('ui_xrange_max') ), column(2, uiOutput('ui_yrange_min'), uiOutput('ui_yrange_max') ), column(8, plotOutput('scatter_plot_2', height = '600px') ) ) ), tabPanel('Fit Line', fluidRow( column(2, selectInput('fitline_y', 'Fit Line', choices = c("TRUE" = TRUE, "FALSE" = FALSE), selected = "FALSE"), textInput('col_fitline', 'Color', 'black') ), column(2, numericInput('lty_fitline', 'Line Type', value = 1, min = 1, max = 5, step = 1), numericInput('lwd_fitline', 'Line Width', value = 1, min = 0.1, step = 0.1) ), column(8, plotOutput('scatter_plot_3', height = '600px') ) ) ), tabPanel('Others', column(4, tabsetPanel(type = 'tabs', tabPanel('Color', fluidRow( column(6, textInput('scatter_colaxis', 'Axis Color: ', 'black'), textInput('scatter_coltitle', 'Title Color: ', 'black') ), column(6, textInput('scatter_collabel', 'Label Color: ', 'black'), textInput('scatter_colsub', 'Subtitle Color: ', 'black') ) ) ), tabPanel('Size', fluidRow( column(6, numericInput('scatter_cexmain', 'Title Size: ', value = 1, min = 0.1, step = 0.1), numericInput('scatter_cexsub', 'Subtitle Size: ', value = 1, min = 0.1, step = 0.1) ), column(6, numericInput('scatter_cexaxis', 'Axis Size: ', value = 1, min = 0.1, step = 0.1), numericInput('scatter_cexlab', 'Label Size: ', value = 1, min = 0.1, step = 0.1) ) ) ), tabPanel('Font', fluidRow( column(6, numericInput('scatter_fontmain', 'Title Font', value = 1, min = 1, max = 5, step = 1), numericInput('scatter_fontsub', 'Subtitle Font', value = 1, min = 1, max = 5, step = 1) ), column(6, numericInput('scatter_fontaxis', 'Axis Font', value = 1, min = 1, max = 5, step = 1), numericInput('scatter_fontlab', 'Label Font', value = 1, min = 1, max = 5, step = 1) ) ) ) ) ), column(8, plotOutput('scatter_plot_4') ) ), tabPanel('Text', column(4, tabsetPanel(type = 'tabs', tabPanel('Text (Inside)', fluidRow( column(6, numericInput( inputId = "scatter_text_x_loc", label = "X Intercept: ", value = 1, step = 1), numericInput( inputId = "scatter_text_y_loc", label = "Y Intercept: ", value = 1, step = 1 ), textInput(inputId = "scatter_plottext", label = "Text:", value = "") ), column(6, numericInput( inputId = "scatter_textfont", label = "Text Font: ", value = 1, min = 1, max = 5, step = 1 ), numericInput( inputId = "scatter_textsize", label = "Text Size: ", value = 1, min = 0.1, step = 0.1 ), textInput( inputId = "scatter_textcolor", label = "Text Color: ", value = "black" ) ) ) ), tabPanel('Marginal Text', fluidRow( column(6, numericInput( inputId = "scatter_mtext_side", label = "Side: ", value = 1, min = 1, max = 4, step = 1 ), numericInput( inputId = "scatter_mtext_line", label = "Line: ", value = 1, step = 1 ), textInput(inputId = "scatter_mtextplot", label = "Text:", value = ""), numericInput( inputId = "scatter_mtextsize", label = "Text Size: ", value = 1, min = 0.1, step = 0.1 ) ), column(6, numericInput( inputId = "scatter_mtextadj", label = "Adj: ", value = 0.5, min = 0, max = 1, step = 0.1 ), numericInput( inputId = "scatter_mtextfont", label = "Text Font: ", value = 1, min = 1, max = 5, step = 1 ), textInput( inputId = "scatter_mtextcolor", label = "Text Color: ", value = "black" ) ) ) ) ) ), column(8, plotOutput('scatter_plot_5', height = '600px') ) ), tabPanel('Plot', fluidRow( column(8, offset = 2, plotOutput('scatter_plot_final') ) ) ) ) ) ) ) )
/scratch/gouwar.j/cran-all/cranData/xplorerr/inst/app-visualize/ui/ui_scatter.R
tabPanel('Scatter Plot', value = 'tab_scatter_prh', fluidPage( fluidRow( column(12, align = 'left', h4('Scatter Plot') ) ), hr(), fluidRow( column(12, tabsetPanel(type = 'tabs', tabPanel('plotly', fluidRow( column(2, selectInput('scatly_select_x', 'Variable X: ', choices = "", selected = ""), textInput(inputId = "scatly_xlabel", label = "X Axes Label: ", value = "label"), textInput(inputId = "scatly_title", label = "Title: ", value = "title"), textInput(inputId = "scatly_color", label = "Color: ", value = ""), textInput(inputId = "scatly_symbol", label = "Symbol: ", value = "circle"), selectInput('scatly_fit', 'Fit Line', choices = c("TRUE" = TRUE, "FALSE" = FALSE), selected = "FALSE", width = '150px'), textInput(inputId = "scatly_ltype", label = "Line Type: ", value = "dashed") ), column(2, selectInput('scatly_select_y', 'Variable Y: ', choices = "", selected = ""), textInput(inputId = "scatly_ylabel", label = "Y Axes Label: ", value = "label"), textInput(inputId = "scatly_text", label = "Text: ", value = ""), numericInput(inputId = "scatly_opacity", label = "Opacity: ", min = 0, max = 1, step = 0.1, value = 0.5), numericInput(inputId = "scatly_size", label = "Size: ", min = 1, step = 1, value = 5), textInput(inputId = "scatly_lcol", label = "Line Color: ", value = ""), numericInput(inputId = "scatly_lsize", label = "Line Width: ", min = 0, step = 0.1, value = 1) ), column(8, align = 'center', plotly::plotlyOutput('scatly_plot_1', height = '600px') ) ) ), tabPanel('rbokeh', fluidRow( column(4, fluidRow( column(6, selectInput('boscat_select_x', 'Variable X: ', choices = "", selected = ""), numericInput(inputId = 'boscat_shape', 'Shape: ', min = 0, max = 25, value = 22, step = 1), textInput(inputId = "boscat_color", label = "Color: ", value = ""), selectInput('boscat_xgrid', 'X Axis Grid: ', choices = c("TRUE" = TRUE, "FALSE" = FALSE), selected = "TRUE"), textInput(inputId = "boscat_xlabel", label = "X Axes Label: ", value = "label"), textInput(inputId = "boscat_title", label = "Title: ", value = "title") ), column(6, selectInput('boscat_select_y', 'Variable Y: ', choices = "", selected = ""), numericInput(inputId = 'boscat_size', 'Size: ', min = 0, value = 5, step = 1), numericInput(inputId = 'boscat_alpha', 'Alpha: ', min = 0, max = 1, value = 1, step = 0.1), selectInput('boscat_ygrid', 'Y Axis Grid: ', choices = c("TRUE" = TRUE, "FALSE" = FALSE), selected = "TRUE"), textInput(inputId = "boscat_ylabel", label = "Y Axes Label: ", value = "label"), selectInput('boscat_fitline', 'Fit Line: ', choices = c("TRUE" = TRUE, "FALSE" = FALSE), selected = "FALSE") ) ), fluidRow(column(12, h5('Fit Line'))), fluidRow( column(6, numericInput(inputId = 'boscat_fint', 'Intercept: ', value = 0, step = 1), textInput(inputId = "boscat_lcolor", label = "Color: ", value = ""), numericInput(inputId = 'boscat_lwidth', 'Width: ', min = 0, value = 1, step = 0.1) ), column(6, numericInput(inputId = 'boscat_fslope', 'Slope: ', value = 0, step = 1), numericInput(inputId = 'boscat_lalpha', 'Alpha: ', min = 0, max = 1, value = 1, step = 0.1), numericInput(inputId = 'boscat_ltype', 'Type: ', min = 1, value = 1, max = 5, step = 1) ) ) ), column(8, align = 'center', rbokeh::rbokehOutput('boscat_plot_1', height = '600px') ) ) ), tabPanel('highcharts', fluidRow( column(2, selectInput('hiscat_select_x', 'Variable X: ', choices = "", selected = ""), textInput(inputId = "hiscat_symbol", label = "Symbol: ", value = "circle"), textInput(inputId = "hiscat_color", label = "Color: ", value = "blue"), numericInput(inputId = "hiscat_lsize", label = "Line Width: ", min = 0, step = 0.1, value = 4), textInput(inputId = "hiscat_title", label = "Title: ", value = "title"), textInput(inputId = "hiscat_xlabel", label = "X Axes Label: ", value = "label") ), column(2, selectInput('hiscat_select_y', 'Variable Y: ', choices = "", selected = ""), numericInput(inputId = "hiscat_size", label = "Size: ", min = 1, step = 1, value = 5), selectInput('hiscat_fit', 'Fit Line', choices = c("TRUE" = TRUE, "FALSE" = FALSE), selected = "FALSE", width = '150px'), textInput(inputId = "hiscat_lcol", label = "Line Color: ", value = "black"), textInput(inputId = "hiscat_subtitle", label = "Subtitle: ", value = "title"), textInput(inputId = "hiscat_ylabel", label = "Y Axes Label: ", value = "label") ), column(8, align = 'center', highcharter::highchartOutput('hiscat_plot_1', height = '600px') ) ) ) ) ) ) ) )
/scratch/gouwar.j/cran-all/cranData/xplorerr/inst/app-visualize/ui/ui_scatter_prh.R
tabPanel('Screen', value = 'tab_scr', icon = icon('binoculars'), navlistPanel(id = 'navlist_scr', well = FALSE, widths = c(2, 10), source('ui/ui_screen.R', local = TRUE)[[1]] ) )
/scratch/gouwar.j/cran-all/cranData/xplorerr/inst/app-visualize/ui/ui_scr.R
tabPanel('Screen', value = 'tab_screen', fluidPage( fluidRow( column(8, align = 'left', h4('Data Screening'), p('Screen data for missing values, verify column names and data types.') ), column(4, align = 'right', actionButton(inputId='dscreenlink1', label="Help", icon = icon("question-circle"), onclick ="window.open('https://descriptr.rsquaredacademy.com/reference/ds_screener.html', '_blank')"), actionButton(inputId='dscreenlink3', label="Demo", icon = icon("video-camera"), onclick ="window.open('https://www.youtube.com/watch?v=IckaPr19Bvc#t=03m17s', '_blank')") ) ), hr(), fluidRow( column(12, align = 'center', verbatimTextOutput('screen') ) ), fluidRow( br(), column(12, align = 'center', actionButton('finalok', 'Approve', width = '120px', icon = icon('sign-out')), bsTooltip("finalok", "Click here to approve the data.", "top", options = list(container = "body")) ) ) ) )
/scratch/gouwar.j/cran-all/cranData/xplorerr/inst/app-visualize/ui/ui_screen.R
tabPanel('Select', value = 'tab_sel', icon = icon('database'), navlistPanel(id = 'navlist_up', well = FALSE, widths = c(2, 10), source('ui/ui_seldata.R', local = TRUE)[[1]] ) )
/scratch/gouwar.j/cran-all/cranData/xplorerr/inst/app-visualize/ui/ui_sel.R
tabPanel("Select Data", value = "tab_seldata", fluidPage( fluidRow( column(6, align = 'left', h4('Select Data Set'), p('Select a data set from the drop down box and click on submit.') ), column(6, align = 'right', actionButton(inputId='seldatalink', label="Demo", icon = icon("video-camera"), onclick ="window.open('https://www.youtube.com/watch?v=IckaPr19Bvc#t=01m14s', '_blank')") ) ), hr(), fluidRow( column(12, align = "center", selectInput( inputId = "sel_data", label = "Select a data set:", choices = '', # choices = c('csv', 'excel', 'json', 'spss', 'stata', 'sas'), selected = '', width = '200px', ) ) ), fluidRow( column(12, align = 'center', br(), actionButton(inputId = 'submit_seldata', label = 'Submit', width = '120px', icon = icon('check')), bsTooltip("submit_seldata", "Click here to select data.", "bottom", options = list(container = "body"))) ) ) )
/scratch/gouwar.j/cran-all/cranData/xplorerr/inst/app-visualize/ui/ui_seldata.R
tabPanel('Select Variables', value = 'tab_selvar', fluidPage( fluidRow( column(6, align = 'left', h4('Select Variables'), p('Click on Yes to select variables.') ), column(6, align = 'right', actionButton(inputId='selvarlink', label="Demo", icon = icon("video-camera"), onclick ="window.open('https://www.youtube.com/watch?v=IckaPr19Bvc#t=02m19s', '_blank')") ) ), hr(), fluidRow( column(12, align = 'center', h4('Do you want to select variables?') ) ), fluidRow( column(6, align = 'right', actionButton( inputId = 'button_selvar_yes', label = 'Yes', width = '120px' ) ), column(6, align = 'left', actionButton( inputId = 'button_selvar_no', label = 'No', width = '120px' ) ) ), fluidRow( br(), br(), uiOutput('show_sel_button') ), fluidRow( uiOutput('sub_sel_button') ) ) )
/scratch/gouwar.j/cran-all/cranData/xplorerr/inst/app-visualize/ui/ui_select.R
tabPanel('Transform', value = 'tab_trans', icon = icon('rotate-right'), navlistPanel(id = 'navlist_trans', well = FALSE, widths = c(2, 10), source('ui/ui_seldata.R', local = TRUE)[[1]], source('ui/ui_transform2.R', local = TRUE)[[1]], source('ui/ui_select.R', local = TRUE)[[1]], source('ui/ui_filter.R', local = TRUE)[[1]] ) )
/scratch/gouwar.j/cran-all/cranData/xplorerr/inst/app-visualize/ui/ui_trans.R
tabPanel('Transform', value = 'tab_transform', fluidPage( fluidRow( column(6, align = 'left', h4('Data Transformation'), p('Rename variables and modify data types.') ), column(6, align = 'right', actionButton(inputId='translink3', label="Demo", icon = icon("video-camera"), onclick ="window.open('https://www.youtube.com/watch?v=IckaPr19Bvc#t=01m23s', '_blank')") ) ), hr(), fluidRow( column(3, tags$h5('Variable')), column(3, tags$h5('Rename Variable')), column(3, tags$h5('Modify Data Type')) ), column(12, uiOutput('trans_try')), fluidRow( tags$br() ), fluidRow( column(12, align = 'center', br(), actionButton(inputId="apply_changes", label="Apply Changes", icon = icon('thumbs-up')), bsTooltip("apply_changes", "Click here to apply changes to data.", "top", options = list(container = "body")), br(), br() ) ) ) )
/scratch/gouwar.j/cran-all/cranData/xplorerr/inst/app-visualize/ui/ui_transform2.R
tabPanel('Get Data', value = 'tab_upload', icon = icon('server'), navlistPanel(id = 'navlist_up', well = FALSE, widths = c(2, 10), source('ui/ui_dataoptions.R', local = TRUE)[[1]], source('ui/ui_datafiles.R', local = TRUE)[[1]], source('ui/ui_datasamples.R', local = TRUE)[[1]] # source('ui/ui_upload.R', local = TRUE)[[1]], # source('ui/ui_excel.R', local = TRUE)[[1]], # source('ui/ui_json.R', local = TRUE)[[1]], # source('ui/ui_stata.R', local = TRUE)[[1]], # source('ui/ui_spss.R', local = TRUE)[[1]], # source('ui/ui_sas.R', local = TRUE)[[1]] ) )
/scratch/gouwar.j/cran-all/cranData/xplorerr/inst/app-visualize/ui/ui_up.R
tabPanel('View', value = 'tab_vi', icon = icon('sort'), navlistPanel(id = 'navlist_vi', well = FALSE, widths = c(2, 10), source('ui/ui_view.R', local = TRUE)[[1]] ) )
/scratch/gouwar.j/cran-all/cranData/xplorerr/inst/app-visualize/ui/ui_vi.R
tabPanel('View', value = 'tab_view', fluidPage( br(), fluidRow( column(6, align = 'left', actionButton(inputId='view2getdata', label=" Get Data", icon = icon("long-arrow-left")) ), column(6, align = 'right', actionButton(inputId='view2analyze', label="Analyze Data", icon = icon("long-arrow-right")) ) ), hr(), fluidRow( dataTableOutput(outputId = "table") ) ) )
/scratch/gouwar.j/cran-all/cranData/xplorerr/inst/app-visualize/ui/ui_view.R
navbarMenu('Visualize', icon = icon('line-chart'), source('ui/ui_vizmenu.R', local = TRUE)[[1]], # source('ui/ui_vizlib.R', local = TRUE)[[1]], source('ui/ui_base.R', local = TRUE)[[1]], source('ui/ui_ggplot.R', local = TRUE)[[1]], source('ui/ui_others.R', local = TRUE)[[1]] )
/scratch/gouwar.j/cran-all/cranData/xplorerr/inst/app-visualize/ui/ui_visualize.R
tabPanel("Base", value = "tab_viz_base", fluidPage( fluidRow( column(12, align = 'center', h3("What do you want to do?") ) ), br(), fluidRow(column(6, offset = 3, hr())), fluidRow( column(3), column(4, align = 'left', h5("Compare data across categories") ), column(2, align = 'left', actionButton(inputId = "click_bar_base", label = "Bar Chart", width = "120px" ) ), column(3) ), fluidRow(column(6, offset = 3, hr())), fluidRow( column(3), column(4, align = 'left', h5("Compare data of sub groups across categories") ), column(2, align = 'left', actionButton(inputId = "click_bar2_base", label = "Bar Chart 2", width = "120px" ) ), column(3) ), fluidRow(column(6, offset = 3, hr())), fluidRow( column(3), column(4, align = 'left', h5("View trends in data over time") ), column(2, align = 'left', actionButton(inputId = "click_line_base", label = "Line Chart", width = "120px" ) ), column(3) ), fluidRow(column(6, offset = 3, hr())), fluidRow( column(3), column(4, align = 'left', h5("Display proportions") ), column(2, align = 'left', actionButton(inputId = "click_pie_base", label = "Pie Chart", width = "120px" ) ), column(3) ), fluidRow(column(6, offset = 3, hr())), fluidRow( column(3), column(4, align = 'left', h5("Display proportions (3d)") ), column(2, align = 'left', actionButton(inputId = "click_pie2_base", label = "Pie Chart 3d", width = "120px" ) ), column(3) ), fluidRow(column(6, offset = 3, hr())), fluidRow( column(3), column(4, align = 'left', h5("Explore relationship between continuous variables") ), column(2, align = 'left', actionButton(inputId = "click_scatter_base", label = "Scatter Plot", width = "120px" ) ), column(3) ), fluidRow(column(6, offset = 3, hr())), fluidRow( column(3), column(4, align = 'left', h5("Understand distribution of your data") ), column(2, align = 'left', actionButton(inputId = "click_hist_base", label = "Histogram", width = "120px" ) ), column(3) ), fluidRow(column(6, offset = 3, hr())), fluidRow( column(3), column(4, align = 'left', h5("Understand distribution and/or identify outliers") ), column(2, align = 'left', actionButton(inputId = "click_box_base", label = "Box Plot", width = "120px" ) ), column(3) ), fluidRow(column(6, offset = 3, hr())), fluidRow( column(3), column(4, align = 'left', h5("Compare distribution across groups and/or identify outliers") ), column(2, align = 'left', actionButton(inputId = "click_box2_base", label = "Box Plot 2", width = "120px" ) ), column(3) ), fluidRow(column(6, offset = 3, hr())) ) )
/scratch/gouwar.j/cran-all/cranData/xplorerr/inst/app-visualize/ui/ui_viz_base.R
tabPanel("ggplot2", value = "tab_viz_gg", fluidPage( fluidRow( column(12, align = 'center', h3("What do you want to do?") ) ), br(), fluidRow(column(6, offset = 3, hr())), fluidRow( column(3), column(4, align = 'left', h5("Compare data across categories") ), column(2, align = 'left', actionButton(inputId = "click_bar_gg", label = "Bar Chart", width = "120px" ) ), column(3) ), fluidRow(column(6, offset = 3, hr())), fluidRow( column(3), column(4, align = 'left', h5("Compare data of sub groups across categories") ), column(2, align = 'left', actionButton(inputId = "click_bar2_gg", label = "Bar Chart 2", width = "120px" ) ), column(3) ), fluidRow(column(6, offset = 3, hr())), fluidRow( column(3), column(4, align = 'left', h5("View trends in data over time") ), column(2, align = 'left', actionButton(inputId = "click_line_gg", label = "Line Chart", width = "120px" ) ), column(3) ), fluidRow(column(6, offset = 3, hr())), fluidRow( column(3), column(4, align = 'left', h5("View trends in data over time") ), column(2, align = 'left', actionButton(inputId = "click_line2_gg", label = "Line Chart 2", width = "120px" ) ), column(3) ), fluidRow(column(6, offset = 3, hr())), fluidRow( column(3), column(4, align = 'left', h5("Display proportions") ), column(2, align = 'left', actionButton(inputId = "click_pie_gg", label = "Pie Chart", width = "120px" ) ), column(3) ), fluidRow(column(6, offset = 3, hr())), fluidRow( column(3), column(4, align = 'left', h5("Explore relationship between continuous variables") ), column(2, align = 'left', actionButton(inputId = "click_scatter_gg", label = "Scatter Plot", width = "120px" ) ), column(3) ), fluidRow(column(6, offset = 3, hr())), fluidRow( column(3), column(4, align = 'left', h5("Understand distribution of your data") ), column(2, align = 'left', actionButton(inputId = "click_hist_gg", label = "Histogram", width = "120px" ) ), column(3) ), fluidRow(column(6, offset = 3, hr())), fluidRow( column(3), column(4, align = 'left', h5("Understand distribution and/or identify outliers") ), column(2, align = 'left', actionButton(inputId = "click_box_gg", label = "Box Plot", width = "120px" ) ), column(3) ), fluidRow(column(6, offset = 3, hr())), fluidRow( column(3), column(4, align = 'left', h5("Compare distribution across groups and/or identify outliers") ), column(2, align = 'left', actionButton(inputId = "click_box2_gg", label = "Box Plot 2", width = "120px" ) ), column(3) ), fluidRow(column(6, offset = 3, hr())) ) )
/scratch/gouwar.j/cran-all/cranData/xplorerr/inst/app-visualize/ui/ui_viz_gg.R
tabPanel("Others", value = "tab_viz_others", fluidPage( fluidRow( column(12, align = 'center', h3("What do you want to do?") ) ), br(), fluidRow(column(6, offset = 3, hr())), fluidRow( column(3), column(4, align = 'left', h5("Compare data across categories") ), column(2, align = 'left', actionButton(inputId = "click_bar_others", label = "Bar Chart", width = "120px" ) ), column(3) ), fluidRow(column(6, offset = 3, hr())), fluidRow( column(3), column(4, align = 'left', h5("Compare data of sub groups across categories") ), column(2, align = 'left', actionButton(inputId = "click_bar2_others", label = "Bar Chart 2", width = "120px" ) ), column(3) ), fluidRow(column(6, offset = 3, hr())), fluidRow( column(3), column(4, align = 'left', h5("View trends in data over time") ), column(2, align = 'left', actionButton(inputId = "click_line_others", label = "Line Chart", width = "120px" ) ), column(3) ), fluidRow(column(6, offset = 3, hr())), fluidRow( column(3), column(4, align = 'left', h5("Display proportions") ), column(2, align = 'left', actionButton(inputId = "click_pie_others", label = "Pie Chart", width = "120px" ) ), column(3) ), fluidRow(column(6, offset = 3, hr())), fluidRow( column(3), column(4, align = 'left', h5("Explore relationship between continuous variables") ), column(2, align = 'left', actionButton(inputId = "click_scatter_others", label = "Scatter Plot", width = "120px" ) ), column(3) ), fluidRow(column(6, offset = 3, hr())), fluidRow( column(3), column(4, align = 'left', h5("Understand distribution of your data") ), column(2, align = 'left', actionButton(inputId = "click_hist_others", label = "Histogram", width = "120px" ) ), column(3) ), fluidRow(column(6, offset = 3, hr())), fluidRow( column(3), column(4, align = 'left', h5("Understand distribution and/or identify outliers") ), column(2, align = 'left', actionButton(inputId = "click_box_others", label = "Box Plot", width = "120px" ) ), column(3) ), fluidRow(column(6, offset = 3, hr())), fluidRow( column(3), column(4, align = 'left', h5("Compare distribution across groups and/or identify outliers") ), column(2, align = 'left', actionButton(inputId = "click_box2_others", label = "Box Plot 2", width = "120px" ) ), column(3) ), fluidRow(column(6, offset = 3, hr())) ) )
/scratch/gouwar.j/cran-all/cranData/xplorerr/inst/app-visualize/ui/ui_viz_others.R
tabPanel("Home", value = "tab_home_viz", fluidPage( fluidRow( column(12, align = 'center', h3("Please choose a library") ) ), fluidRow(column(12, hr())), br(), br(), fluidRow( column(1), column(2, align = 'right', img(src = 'Rlogonew.png', width = '100px', height = '100px') ), column(6, align = 'center', h5("Visualize data using the graphics pacakge from base R") ), column(2, align = 'left', actionButton(inputId = "click_base", label = "Click Here", width = "120px" ) ), column(1) ), br(), br(), fluidRow( column(1), column(2, align = 'right', img(src = 'ggplot2_logo.png', width = '100px', height = '100px') ), column(6, align = 'center', h5("Visualize data using ggplot2 (based on Grammar of Graphics)") ), column(2, align = 'left', actionButton(inputId = "click_ggplot2", label = "Click Here", width = "120px" ) ), column(1) ), br(), br(), fluidRow( column(1), column(2, align = 'right', img(src = 'highcharts_logo.png', width = '40px', height = '40px'), img(src = 'bokeh_logo.png', width = '40px', height = '40px'), img(src = 'plotly_logo.png', width = '40px', height = '40px') ), column(6, align = 'center', h5("Visualize data using plotly, rbokeh or highcharts") ), column(2, align = 'left', actionButton(inputId = "click_prh", label = "Click Here", width = "120px" ) ), column(1) ), fluidRow(column(12)) ) )
/scratch/gouwar.j/cran-all/cranData/xplorerr/inst/app-visualize/ui/ui_vizhome.R
tabPanel('Libraries', value = 'tab_viz_lib', fluidPage( fluidRow( column(12, align = 'center', uiOutput('vizlib_bar') ), column(12, align = 'center', uiOutput('vizlib_line') ), column(12, align = 'center', uiOutput('vizlib_pie') ), column(12, align = 'center', uiOutput('vizlib_scatter') ), column(12, align = 'center', uiOutput('vizlib_hist') ), column(12, align = 'center', uiOutput('vizlib_box') ) ) ) )
/scratch/gouwar.j/cran-all/cranData/xplorerr/inst/app-visualize/ui/ui_vizlib.R
tabPanel('Home', value = 'tab_viz_home', icon = icon('home'), navlistPanel(id = 'navlist_vizmenu', well = FALSE, widths = c(2, 10), source('ui/ui_vizhome.R', local = TRUE)[[1]], source('ui/ui_viz_base.R', local = TRUE)[[1]], source('ui/ui_viz_gg.R', local = TRUE)[[1]], source('ui/ui_viz_others.R', local = TRUE)[[1]] ) )
/scratch/gouwar.j/cran-all/cranData/xplorerr/inst/app-visualize/ui/ui_vizmenu.R
library(shiny) library(shinyBS) library(shinythemes) library(descriptr) library(dplyr) shinyUI( navbarPage(HTML("visualizer"), id = 'mainpage', source('ui/ui_data.R', local = TRUE)[[1]], source('ui/ui_visualize.R', local = TRUE)[[1]], source('ui/ui_exit_button.R', local = TRUE)[[1]] ))
/scratch/gouwar.j/cran-all/cranData/xplorerr/inst/app-visualize/ui.R
#' Analysis Dataset Subject Level #' #' An example dataset containing subject level data #' #' @source Dataset created by `admiral::use_ad_template("adsl")` #' @usage data("adsl_xportr") #' #' @format ## `adsl_xportr` #' A data frame with 306 rows and 51 columns: #' \describe{ #' \item{STUDYID}{Study Identifier} #' \item{USUBJID}{Unique Subject Identifier} #' \item{SUBJID}{Subject Identifier for the Study} #' \item{RFSTDTC}{Subject Reference Start Date/Time} #' \item{RFENDTC}{Subject Reference End Date/Time} #' \item{RFXSTDTC}{Date/Time of First Study Treatment} #' \item{RFXENDTC}{Date/Time of Last Study Treatment} #' \item{RFICDTC}{Date/Time of Informed Consent} #' \item{RFPENDTC}{Date/Time of End of Participation} #' \item{DTHDTC}{Date/Time of Death} #' \item{DTHFL}{Subject Death Flag} #' \item{SITEID}{Study Site Identifier} #' \item{AGE}{Age} #' \item{AGEU}{Age Units} #' \item{SEX}{Sex} #' \item{RACE}{Race} #' \item{ETHNIC}{Ethnicity} #' \item{ARMCD}{Planned Arm Code} #' \item{ARM}{Description of Planned Arm} #' \item{ACTARMCD}{Actual Arm Code} #' \item{ACTARM}{Description of Actual Arm} #' \item{COUNTRY}{Country} #' \item{DMDTC}{Date/Time of Collection} #' \item{DMDY}{Study Day of Collection} #' \item{TRT01P}{Planned Treatment for Period 01} #' \item{TRT01A}{Actual Treatment for Period 01} #' \item{TRTSDTM}{Datetime of First Exposure to Treatment} #' \item{TRTSTMF}{Time of First Exposure Imputation Flag} #' \item{TRTEDTM}{Datetime of Last Exposure to Treatment} #' \item{TRTETMF}{Time of Last Exposure Imputation Flag} #' \item{TRTSDT}{Date of First Exposure to Treatment} #' \item{TRTEDT}{Date of Last Exposure to Treatment} #' \item{TRTDURD}{Total Treatment Duration (Days)} #' \item{SCRFDT}{Screen Failure Date} #' \item{EOSDT}{End of Study Date} #' \item{EOSSTT}{End of Study Status} #' \item{FRVDT}{Final Retrieval Visit Date} #' \item{RANDDT}{Date of Randomization} #' \item{DTHDT}{Date of Death} #' \item{DTHDTF}{Date of Death Imputation Flag} #' \item{DTHADY}{Relative Day of Death} #' \item{LDDTHELD}{Elapsed Days from Last Dose to Death} #' \item{LSTALVDT}{Date Last Known Alive} #' \item{SAFFL}{Safety Population Flag} #' \item{RACEGR1}{Pooled Race Group 1} #' \item{AGEGR1}{Pooled Age Group 1} #' \item{REGION1}{Geographic Region 1} #' \item{LDDTHGR1}{Last Dose to Death - Days Elapsed Group 1} #' \item{DTH30FL}{Death Within 30 Days of Last Trt Flag} #' \item{DTHA30FL}{Death After 30 Days from Last Trt Flag} #' \item{DTHB30FL}{Death Within 30 Days of First Trt Flag} #' } "adsl_xportr" #' Example Dataset Variable Specification #' #' @usage data("var_spec") #' #' @format ## `var_spec` #' A data frame with 216 rows and 19 columns: #' \describe{ #' \item{Order}{Order of variable} #' \item{Dataset}{Dataset} #' \item{Variable}{Variable} #' \item{Label}{Variable Label} #' \item{Data Type}{Data Type} #' \item{Length}{Variable Length} #' \item{Significant Digits}{Significant Digits} #' \item{Format}{Variable Format} #' \item{Mandatory}{Mandatory Variable Flag} #' \item{Assigned Value}{Variable Assigned Value} #' \item{Codelist}{Variable Codelist} #' \item{Common}{Common Variable Flag} #' \item{Origin}{Variable Origin} #' \item{Pages}{Pages} #' \item{Method}{Variable Method} #' \item{Predecessor}{Variable Predecessor} #' \item{Role}{Variable Role} #' \item{Comment}{Comment} #' \item{Developer Notes}{Developer Notes} #' } "var_spec" #' Example Dataset Specification #' #' @usage data("dataset_spec") #' @format ## `dataset_spec` #' A data frame with 1 row and 9 columns: #' \describe{ #' \item{Dataset}{chr: Dataset} #' \item{Description}{chr: Dataset description} #' \item{Class}{chr: Dataset class} #' \item{Structure}{lgl: Logical, indicating if there's a specific structure} #' \item{Purpose}{chr: Purpose of the dataset} #' \item{Key, Variables}{chr: Join Key variables in the dataset} #' \item{Repeating}{chr: Indicates if the dataset is repeating} #' \item{Reference Data}{lgl: Reference Data} #' \item{Comment}{chr: Additional comment} #' } "dataset_spec"
/scratch/gouwar.j/cran-all/cranData/xportr/R/data.R
#' Assign Dataset Label #' #' Assigns dataset label from a dataset level metadata to a given data frame. #' This is stored in the 'label' attribute of the dataframe. #' #' @param metadata A data frame containing dataset. See 'Metadata' section for #' details. #' @inheritParams xportr_length #' #' @return Data frame with label attributes. #' #' @section Metadata: The argument passed in the 'metadata' argument can either #' be a metacore object, or a data.frame containing the data listed below. If #' metacore is used, no changes to options are required. #' #' For data.frame 'metadata' arguments two columns must be present: #' #' 1) Domain Name - passed as the 'xportr.df_domain_name' option. Default: #' "dataset". This is the column subset by the 'domain' argument in the #' function. #' #' 2) Label Name - passed as the 'xportr.df_label' option. Default: #' "label". Character values to update the 'label' attribute of the #' dataframe This is passed to `haven::write_xpt` to note the label. #' #' @export #' #' @examples #' adsl <- data.frame( #' USUBJID = c(1001, 1002, 1003), #' SITEID = c(001, 002, 003), #' AGE = c(63, 35, 27), #' SEX = c("M", "F", "M") #' ) #' #' metadata <- data.frame( #' dataset = c("adsl", "adae"), #' label = c("Subject-Level Analysis", "Adverse Events Analysis") #' ) #' #' adsl <- xportr_df_label(adsl, metadata, domain = "adsl") xportr_df_label <- function(.df, metadata = NULL, domain = NULL, metacore = deprecated()) { if (!missing(metacore)) { lifecycle::deprecate_stop( when = "0.3.1.9005", what = "xportr_df_label(metacore = )", with = "xportr_df_label(metadata = )" ) } ## Common section to detect default arguments domain <- domain %||% attr(.df, "_xportr.df_arg_") if (!is.null(domain)) attr(.df, "_xportr.df_arg_") <- domain metadata <- metadata %||% attr(.df, "_xportr.df_metadata_") ## End of common section assert_data_frame(.df) assert_string(domain, null.ok = TRUE) assert_metadata(metadata) domain_name <- getOption("xportr.df_domain_name") label_name <- getOption("xportr.df_label") if (inherits(metadata, "Metacore")) metadata <- metadata$ds_spec label <- metadata %>% filter(!!sym(domain_name) == .env$domain) %>% select(!!sym(label_name)) %>% # If a dataframe is used this will also be a dataframe, change to character. as.character() if (!test_string(label, max.chars = 40)) { abort("Length of dataset label must be 40 characters or less.") } if (stringr::str_detect(label, "[^[:ascii:]]")) { abort("`label` cannot contain any non-ASCII, symbol or special characters.") } attr(.df, "label") <- label .df }
/scratch/gouwar.j/cran-all/cranData/xportr/R/df_label.R
#' Assign SAS Format #' #' Assigns a SAS format from a variable level metadata to a given data frame. If #' no format is found for a given variable, it is set as an empty character #' vector. This is stored in the '`format.sas`' attribute. #' #' @inheritParams xportr_length #' #' @return Data frame with `SASformat` attributes for each variable. #' #' @section Format Checks: This function carries out a series of basic #' checks to ensure the formats being applied make sense. #' #' Note, the 'type' of message that is generated will depend on the value #' passed to the `verbose` argument: with 'stop' producing an error, 'warn' #' producing a warning, or 'message' producing a message. A value of 'none' #' will not output any messages. #' #' 1) If the variable has a suffix of `DT`, `DTM`, `TM` (indicating a #' numeric date/time variable) then a message will be shown if there is #' no format associated with it. #' #' 2) If a variable is character then a message will be shown if there is #' no `$` prefix in the associated format. #' #' 3) If a variable is character then a message will be shown if the #' associated format has greater than 31 characters (excluding the `$`). #' #' 4) If a variable is numeric then a message will be shown if there is a #' `$` prefix in the associated format. #' #' 5) If a variable is numeric then a message will be shown if the #' associated format has greater than 32 characters. #' #' 6) All formats will be checked against a list of formats considered #' 'standard' as part of an ADaM dataset. Note, however, this list is not #' exhaustive (it would not be feasible to check all the functions #' within the scope of this package). If the format is not found in the #' 'standard' list, then a message is created advising the user to #' check. #' #' | \strong{Format Name} | \strong{w Values} | \strong{d Values} | #' |----------------------|-------------------|--------------------| #' | w.d | 1 - 32 | ., 0 - 31 | #' | $w. | 1 - 200 | | #' | DATEw. | ., 5 - 11 | | #' | DATETIMEw. | 7 - 40 | | #' | DDMMYYw. | ., 2 - 10 | | #' | HHMM. | | | #' | MMDDYYw. | ., 2 - 10 | | #' | TIMEw. | ., 2 - 20 | | #' | WEEKDATEw. | ., 3 - 37 | | #' | YYMMDDw. | ., 2 - 10 | | #' | B8601DAw. | ., 8 - 10 | | #' | B8601DTw.d | ., 15 - 26 | ., 0 - 6 | #' | B8601TM. | | | #' | IS8601DA. | | | #' | IS8601TM. | | | #' | E8601DAw. | ., 10 | | #' | E8601DNw. | ., 10 | | #' | E8601DTw.d | ., 16 - 26 | ., 0 - 6 | #' | E8601DXw. | ., 20 - 35 | | #' | E8601LXw. | ., 20 - 35 | | #' | E8601LZw. | ., 9 - 20 | | #' | E8601TMw.d | ., 8 - 15 | ., 0 - 6 | #' | E8601TXw. | ., 9 - 20 | | #' | E8601TZw.d | ., 9 - 20 | ., 0 - 6 | #' #' @section Metadata: The argument passed in the 'metadata' argument can either #' be a metacore object, or a data.frame containing the data listed below. If #' metacore is used, no changes to options are required. #' #' For data.frame 'metadata' arguments three columns must be present: #' #' 1) Domain Name - passed as the 'xportr.domain_name' option. Default: #' "dataset". This is the column subset by the 'domain' argument in the #' function. #' #' 2) Format Name - passed as the 'xportr.format_name' option. Default: #' "format". Character values to update the '`format.sas`' attribute of the #' column. This is passed to `haven::write` to note the format. #' #' 3) Variable Name - passed as the 'xportr.variable_name' option. Default: #' "variable". This is used to match columns in '.df' argument and the #' metadata. #' #' @export #' #' @examples #' adsl <- data.frame( #' USUBJID = c(1001, 1002, 1003), #' BRTHDT = c(1, 1, 2) #' ) #' #' metadata <- data.frame( #' dataset = c("adsl", "adsl"), #' variable = c("USUBJID", "BRTHDT"), #' format = c(NA, "DATE9.") #' ) #' #' adsl <- xportr_format(adsl, metadata, domain = "adsl") xportr_format <- function(.df, metadata = NULL, domain = NULL, verbose = NULL, metacore = deprecated()) { if (!missing(metacore)) { lifecycle::deprecate_stop( when = "0.3.1.9005", what = "xportr_format(metacore = )", with = "xportr_format(metadata = )" ) } ## Common section to detect default arguments domain <- domain %||% attr(.df, "_xportr.df_arg_") if (!is.null(domain)) attr(.df, "_xportr.df_arg_") <- domain metadata <- metadata %||% attr(.df, "_xportr.df_metadata_") # Verbose should use an explicit verbose option first, then the value set in # metadata, and finally fall back to the option value verbose <- verbose %||% attr(.df, "_xportr.df_verbose_") %||% getOption("xportr.length_verbose", "none") ## End of common section assert_data_frame(.df) assert_string(domain, null.ok = TRUE) assert_metadata(metadata) assert_choice(verbose, choices = .internal_verbose_choices) domain_name <- getOption("xportr.domain_name") format_name <- getOption("xportr.format_name") variable_name <- getOption("xportr.variable_name") if (inherits(metadata, "Metacore")) metadata <- metadata$var_spec if (domain_name %in% names(metadata) && !is.null(domain)) { metadata <- metadata %>% filter(!!sym(domain_name) == .env$domain & !is.na(!!sym(format_name))) } else { # Common check for multiple variables name check_multiple_var_specs(metadata, variable_name) } filtered_metadata <- metadata %>% filter(!!sym(variable_name) %in% names(.df)) format <- filtered_metadata %>% select(!!sym(format_name)) %>% unlist() %>% toupper() names(format) <- filtered_metadata[[variable_name]] # Returns modified .df check_formats(.df, format, verbose) } # Internal function to check formats check_formats <- function(.df, format, verbose) { # vector of expected formats for clinical trials (usually character or date/time) # https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/leforinforref # /n0p2fmevfgj470n17h4k9f27qjag.htm#n0wi06aq4kydlxn1uqc0p6eygu75 expected_formats <- .internal_format_list # w.d format for numeric variables format_regex <- .internal_format_regex for (i in seq_len(ncol(.df))) { format_sas <- pluck(format, colnames(.df)[i], .default = "") format_sas[is.na(format_sas)] <- "" # series of checks for formats # check that any variables ending DT, DTM, TM have a format if (identical(format_sas, "")) { if (isTRUE(grepl("(DT|DTM|TM)$", colnames(.df)[i]))) { message <- glue( "(xportr::xportr_format) {encode_vars(colnames(.df)[i])} is expected to have a format but does not." ) xportr_logger(message, type = verbose) } } else { # remaining checks to be carried out if a format exists # if the variable is character if (is.character(.df[[i]])) { # character variable formats should start with a $ if (isFALSE(grepl("^\\$", format_sas))) { message <- glue( "(xportr::xportr_format)", " {encode_vars(colnames(.df)[i])} is a character variable", " and should have a `$` prefix." ) xportr_logger(message, type = verbose) } # character variable formats should have length <= 31 (excluding the $) if (nchar(gsub("[.]$", "", format_sas)) > 32) { message <- glue( "(xportr::xportr_format)", " Format for character variable {encode_vars(colnames(.df)[i])}", " should have length <= 31 (excluding `$`)." ) xportr_logger(message, type = verbose) } } # if the variable is numeric if (is.numeric(.df[[i]])) { # numeric variables should not start with a $ if (isTRUE(grepl("^\\$", format_sas))) { message <- glue( "(xportr::xportr_format)", " {encode_vars(colnames(.df)[i])} is a numeric variable and", " should not have a `$` prefix." ) xportr_logger(message, type = verbose) } # numeric variable formats should have length <= 32 if (nchar(gsub("\\.$", "", format_sas)) > 32) { message <- glue( "(xportr::xportr_format)", " Format for numeric variable {encode_vars(colnames(.df)[i])}", " should have length <= 32." ) xportr_logger(message, type = verbose) } } # check if the format is either one of the expected formats or follows the regular expression for w.d format if ( isFALSE(format_sas %in% toupper(expected_formats)) && isFALSE(str_detect(format_sas, pattern = format_regex)) ) { message <- glue( "(xportr::xportr_format)", " Check format {encode_vars(format_sas)} for variable {encode_vars(colnames(.df)[i])}", " - is this correct?" ) xportr_logger(message, type = verbose) } } attr(.df[[i]], "format.sas") <- format_sas } .df }
/scratch/gouwar.j/cran-all/cranData/xportr/R/format.R
#' Assign Variable Label #' #' Assigns variable label from a variable level metadata to a given data frame. #' This function will give detect if a label is greater than #' 40 characters which isn't allowed in XPT v5. If labels aren't present for the #' variable it will be assigned an empty character value. Labels are stored in #' the 'label' attribute of the column. #' #' @inheritParams xportr_length #' #' @section Messaging: `label_log()` is the primary messaging tool for #' `xportr_label()`. If there are any columns present in the '.df' that are not #' noted in the metadata, they cannot be assigned a label and a message will #' be generated noting the number or variables that have not been assigned a #' label. #' #' If variables were not found in the metadata and the value passed to the #' 'verbose' argument is 'stop', 'warn', or 'message', a message will be #' generated detailing the variables that were missing in metadata. #' #' @section Metadata: The argument passed in the 'metadata' argument can either #' be a metacore object, or a data.frame containing the data listed below. If #' metacore is used, no changes to options are required. #' #' For data.frame 'metadata' arguments three columns must be present: #' #' 1) Domain Name - passed as the 'xportr.domain_name' option. Default: #' "dataset". This is the column subset by the 'domain' argument in the #' function. #' #' 2) Variable Name - passed as the 'xportr.variable_name' option. #' Default: "variable". This is used to match columns in '.df' argument and #' the metadata. #' #' 3) Variable Label - passed as the 'xportr.label' option. #' Default: "label". These character values to update the 'label' attribute of #' the column. This is passed to `haven::write` to note the label. #' #' #' @return Data frame with label attributes for each variable. #' #' @export #' #' @examples #' adsl <- data.frame( #' USUBJID = c(1001, 1002, 1003), #' SITEID = c(001, 002, 003), #' AGE = c(63, 35, 27), #' SEX = c("M", "F", "M") #' ) #' #' metadata <- data.frame( #' dataset = "adsl", #' variable = c("USUBJID", "SITEID", "AGE", "SEX"), #' label = c("Unique Subject Identifier", "Study Site Identifier", "Age", "Sex") #' ) #' #' adsl <- xportr_label(adsl, metadata, domain = "adsl") xportr_label <- function(.df, metadata = NULL, domain = NULL, verbose = NULL, metacore = deprecated()) { if (!missing(metacore)) { lifecycle::deprecate_stop( when = "0.3.1.9005", what = "xportr_label(metacore = )", with = "xportr_label(metadata = )" ) } ## Common section to detect default arguments domain <- domain %||% attr(.df, "_xportr.df_arg_") if (!is.null(domain)) attr(.df, "_xportr.df_arg_") <- domain metadata <- metadata %||% attr(.df, "_xportr.df_metadata_") # Verbose should use an explicit verbose option first, then the value set in # metadata, and finally fall back to the option value verbose <- verbose %||% attr(.df, "_xportr.df_verbose_") %||% getOption("xportr.label_verbose", "none") ## End of common section assert_data_frame(.df) assert_string(domain, null.ok = TRUE) assert_metadata(metadata) assert_choice(verbose, choices = .internal_verbose_choices) domain_name <- getOption("xportr.domain_name") variable_name <- getOption("xportr.variable_name") variable_label <- getOption("xportr.label") if (inherits(metadata, "Metacore")) metadata <- metadata$var_spec if (domain_name %in% names(metadata) && !is.null(domain)) { metadata <- metadata %>% dplyr::filter(!!sym(domain_name) == .env$domain) } else { # Common check for multiple variables name check_multiple_var_specs(metadata, variable_name) } # Check any variables missed in metadata but present in input data --- miss_vars <- setdiff(names(.df), metadata[[variable_name]]) label_log(miss_vars, verbose) label <- metadata[[variable_label]] names(label) <- metadata[[variable_name]] # Check any variable label have more than 40 characters --- label_len <- lapply(label, nchar) err_len <- which(label_len > 40) %>% names() if (length(err_len) > 0) { warn( c("Length of variable label must be 40 characters or less.", x = glue("Problem with {encode_vars(err_len)}.") ) ) } for (i in names(.df)) { attr(.df[[i]], "label") <- if (i %in% miss_vars) { "" } else { label[[i]] } } .df }
/scratch/gouwar.j/cran-all/cranData/xportr/R/label.R
#' Assign SAS Length #' #' Assigns the SAS length to a specified data frame, either from a metadata object #' or based on the calculated maximum data length. If a length isn't present for #' a variable the length value is set to maximum data length for character columns, and 8 #' for non-character columns. This value is stored in the 'width' attribute of the column. #' #' @inheritParams xportr #' @param metadata A data frame containing variable level metadata. See #' 'Metadata' section for details. #' @param length_source Choose the assigned length from either metadata or data. #' #' If `"metadata"` is specified, the assigned length is from the metadata length. #' If `"data"` is specified, the assigned length is determined by the calculated maximum data length. #' #' *Permitted Values*: `"metadata"`, `"data"` #' @param metacore `r lifecycle::badge("deprecated")` Previously used to pass #' metadata now renamed with `metadata` #' #' @section Messaging: `length_log` is the primary messaging tool for #' `xportr_length`. If there are any columns present in the '.df' that are not #' noted in the metadata, they cannot be assigned a length and a message will #' be generated noting the number or variables that have not been assigned a #' length. #' #' If variables were not found in the metadata and the value passed to the #' 'verbose' argument is 'stop', 'warn', or 'message', a message will be #' generated detailing the variables that were missing in the metadata. #' #' @section Metadata: The argument passed in the 'metadata' argument can either #' be a `{metacore}` object, or a data.frame containing the data listed below. If #' metacore is used, no changes to options are required. #' #' For data.frame 'metadata' arguments three columns must be present: #' #' 1) Domain Name - passed as the 'xportr.domain_name' option. Default: #' "dataset". This is the column subset by the 'domain' argument in the #' function. #' #' 2) Variable Name - passed as the 'xportr.variable_name' option. #' Default: "variable". This is used to match columns in '.df' argument and #' the metadata. #' #' 3) Variable Label - passed as the 'xportr.length' option. #' Default: "length". These numeric values to update the 'width' attribute of #' the column. This is passed to `haven::write` to note the variable length. #' #' #' @return Data frame with SAS default length attributes for each variable. #' #' @export #' #' @examples #' adsl <- data.frame( #' USUBJID = c(1001, 1002, 1003), #' BRTHDT = c(1, 1, 2) #' ) #' #' metadata <- data.frame( #' dataset = c("adsl", "adsl"), #' variable = c("USUBJID", "BRTHDT"), #' length = c(10, 8) #' ) #' #' adsl <- xportr_length(adsl, metadata, domain = "adsl", length_source = "metadata") xportr_length <- function(.df, metadata = NULL, domain = NULL, verbose = NULL, length_source = c("metadata", "data"), metacore = deprecated()) { length_source <- match.arg(length_source) if (!missing(metacore)) { lifecycle::deprecate_stop( when = "0.3.1.9005", what = "xportr_length(metacore = )", with = "xportr_length(metadata = )" ) } ## Common section to detect default arguments domain <- domain %||% attr(.df, "_xportr.df_arg_") if (!is.null(domain)) attr(.df, "_xportr.df_arg_") <- domain metadata <- metadata %||% attr(.df, "_xportr.df_metadata_") # Verbose should use an explicit verbose option first, then the value set in # metadata, and finally fall back to the option value verbose <- verbose %||% attr(.df, "_xportr.df_verbose_") %||% getOption("xportr.length_verbose", "none") ## End of common section assert_data_frame(.df) assert_string(domain, null.ok = TRUE) assert_metadata(metadata) assert_choice(verbose, choices = .internal_verbose_choices) domain_name <- getOption("xportr.domain_name") variable_length <- getOption("xportr.length") variable_name <- getOption("xportr.variable_name") if (inherits(metadata, "Metacore")) metadata <- metadata$var_spec if (domain_name %in% names(metadata) && !is.null(domain)) { metadata <- metadata %>% filter(!!sym(domain_name) == .env$domain) } else { # Common check for multiple variables name check_multiple_var_specs(metadata, variable_name) } # Get max length for missing length and when length_source == "data" var_length_max <- variable_max_length(.df) length_data <- var_length_max[[variable_length]] names(length_data) <- var_length_max[[variable_name]] # Check any variables missed in metadata but present in input data --- miss_vars <- setdiff(names(.df), metadata[[variable_name]]) miss_length <- character(0L) width_attr <- if (identical(length_source, "metadata")) { length_metadata <- metadata[[variable_length]] names(length_metadata) <- metadata[[variable_name]] # Check any variables with missing length in metadata miss_length <- names(length_metadata[is.na(length_metadata)]) # Build `width` attribute vapply( names(.df), function(i) { if (i %in% miss_vars || is.na(length_metadata[[i]])) { as.numeric(length_data[[i]]) } else { as.numeric(length_metadata[[i]]) } }, numeric(1L) ) } else if (identical(length_source, "data")) { length_msg <- left_join(var_length_max, metadata[, c(variable_name, variable_length)], by = variable_name) length_msg <- length_msg %>% mutate( length_df = as.numeric(length_msg[[paste0(variable_length, ".x")]]), length_meta = as.numeric(length_msg[[paste0(variable_length, ".y")]]) ) %>% filter(.data$length_df < .data$length_meta) %>% select(any_of(c(variable_name, "length_df", "length_meta"))) max_length_msg(length_msg, verbose) # Build `width` attribute length_data[names(.df)] } for (i in names(.df)) { attr(.df[[i]], "width") <- width_attr[[i]] } # Message for missing var and missing length length_log(miss_vars, miss_length, verbose) .df }
/scratch/gouwar.j/cran-all/cranData/xportr/R/length.R
#' Utility Logging Function #' #' Functions to output user messages, usually relating to differences #' found between dataframe and the metacore/metadata object #' #' @param message Output to be sent out for user #' @param type Three types: abort, warn, inform #' @param ... additional arguments if needed #' #' @return Output to Console #' @noRd xportr_logger <- function(message, type = "none", ...) { assert_character(message) assert_choice(type, choices = .internal_verbose_choices) log_fun <- switch(type, stop = abort, warn = warn, message = inform, return() ) do.call(log_fun, list(message, ...)) } #' Utility for Renaming Variables #' #' @param tidy_names_df dataframe #' @param verbose Provides additional messaging for user #' #' @return Output to Console #' @noRd var_names_log <- function(tidy_names_df, verbose) { assert_data_frame(tidy_names_df) assert_choice(verbose, choices = .internal_verbose_choices) only_renames <- tidy_names_df %>% filter(original_varname != renamed_var) %>% mutate( renamed_msg = glue( "Var {col_pos} : '{original_varname}' was renamed to 'renamed_var'" ) ) # Message regarding number of variables that were renamed/ modified num_renamed <- nrow(only_renames) tot_num_vars <- nrow(tidy_names_df) cli_h2(glue( .sep = " ", "{num_renamed} of {tot_num_vars}", "({round(100*(num_renamed/tot_num_vars), 1)}%)", "variables were renamed" )) # Message stating any renamed variables each original variable and it's new name if (nrow(only_renames) > 0) { purrr::walk(only_renames$renamed_msg, ~ xportr_logger(.x, verbose)) } # Message checking for duplicate variable names after renamed (Pretty sure # this is impossible) but good to have a check none-the-less. dups <- tidy_names_df %>% filter(renamed_n > 1) if (nrow(dups) != 0) { cli::cli_alert_danger( glue( .sep = " ", "Duplicate renamed term(s) were created.", "Consider creating dictionary terms for:", encode_vars(unique(dups$renamed_var)) ) ) } } #' Utility for Types #' #' @param meta_ordered fill in later #' @param type_mismatch_ind fill in later #' @param verbose Provides additional messaging for user #' #' @return Output to Console #' @noRd type_log <- function(meta_ordered, type_mismatch_ind, verbose) { assert_data_frame(meta_ordered) assert_integer(type_mismatch_ind) assert_choice(verbose, choices = .internal_verbose_choices) if (length(type_mismatch_ind) > 0) { cli_h2("Variable type mismatches found.") cli_alert_success("{ length(type_mismatch_ind) } variables coerced") message <- glue( "Variable type(s) in dataframe don't match metadata: ", "{encode_vars(meta_ordered[type_mismatch_ind, 'variable'])}" ) xportr_logger(message, verbose) } } #' Utility for Lengths #' #' @param miss_vars Variables missing from metadata #' @param miss_length Variables with missing length in metadata #' @param verbose Provides additional messaging for user #' #' @return Output to Console #' @noRd length_log <- function(miss_vars, miss_length, verbose) { assert_character(miss_vars) assert_character(miss_length) assert_choice(verbose, choices = .internal_verbose_choices) if (length(c(miss_vars, miss_length)) > 0) { cli_h2("Variable lengths missing from metadata.") cli_alert_success("{ length(c(miss_vars, miss_length)) } lengths resolved {encode_vars(c(miss_vars, miss_length))}") xportr_logger( glue( "Variable(s) present in dataframe but doesn't exist in `metadata`.", "Problem with {encode_vars(miss_vars)}" ), type = verbose ) } } #' Utility for Variable Labels #' #' @param miss_vars Missing variables in metadata #' @param verbose Provides additional messaging for user #' #' @return Output to Console #' @noRd label_log <- function(miss_vars, verbose) { assert_character(miss_vars) assert_choice(verbose, choices = .internal_verbose_choices) if (length(miss_vars) > 0) { cli_h2("Variable labels missing from metadata.") cli_alert_success("{ length(miss_vars) } labels skipped") xportr_logger( c("Variable(s) present in dataframe but doesn't exist in `metadata`.", x = glue("Problem with {encode_vars(miss_vars)}") ), type = verbose ) } } #' Utility for Ordering #' #' @param reordered_vars Number of variables reordered #' @param moved_vars Number of variables moved in the dataset #' @param verbose Provides additional messaging for user #' #' @return Output to Console #' @noRd var_ord_msg <- function(reordered_vars, moved_vars, verbose) { assert_character(reordered_vars) assert_character(moved_vars) assert_choice(verbose, choices = .internal_verbose_choices) if (length(moved_vars) > 0) { cli_h2("{ length(moved_vars) } variables not in spec and moved to end") message <- glue( "Variable moved to end in `.df`: { encode_vars(moved_vars) }" ) xportr_logger(message, verbose) } else { cli_h2("All variables in specification file are in dataset") } if (length(reordered_vars) > 0) { cli_h2("{ length(reordered_vars) } reordered in dataset") message <- glue( "Variable reordered in `.df`: { encode_vars(reordered_vars) }" ) xportr_logger(message, verbose) } else { cli_h2("All variables in dataset are ordered") } } #' Utility for data Lengths #' #' @param max_length Dataframe with data and metadata length #' @param verbose Provides additional messaging for user #' #' @return Output to Console #' @noRd max_length_msg <- function(max_length, verbose) { assert_data_frame(max_length) assert_choice(verbose, choices = .internal_verbose_choices) if (nrow(max_length) > 0) { cli_h2("Variable length is shorter than the length specified in the metadata.") xportr_logger( glue( "Update length in metadata to trim the variables:" ), type = verbose ) xportr_logger( glue( "{format(max_length[[1]], width = 8)} has a length of {format(as.character(max_length[[2]]), width = 3)}", " and a length of {format(as.character(max_length[[3]]), width = 3)} in metadata" ), type = verbose ) } }
/scratch/gouwar.j/cran-all/cranData/xportr/R/messages.R
#' Set variable specifications and domain #' #' Sets metadata and/or domain for a dataset in a way that can be accessed by #' other xportr functions. If used at the start of an xportr pipeline, it #' removes the need to set metadata and domain at each step individually. For #' details on the format of the metadata, see the 'Metadata' section for each #' function in question. #' #' @inheritParams xportr_length #' #' @return `.df` dataset with metadata and domain attributes set #' @export #' #' @rdname metadata #' #' @examples #' #' metadata <- data.frame( #' dataset = "test", #' variable = c("Subj", "Param", "Val", "NotUsed"), #' type = c("numeric", "character", "numeric", "character"), #' format = NA, #' order = c(1, 3, 4, 2) #' ) #' #' adlb <- data.frame( #' Subj = as.character(123, 456, 789), #' Different = c("a", "b", "c"), #' Val = c("1", "2", "3"), #' Param = c("param1", "param2", "param3") #' ) #' #' xportr_metadata(adlb, metadata, "test") #' #' library(magrittr) #' #' adlb %>% #' xportr_metadata(metadata, "test") %>% #' xportr_type() %>% #' xportr_order() xportr_metadata <- function(.df, metadata = NULL, domain = NULL, verbose = NULL) { if (is.null(metadata) && is.null(domain)) { stop("Assertion failed on `metadata` and `domain`: Must provide either `metadata` or `domain` argument") } ## Common section to detect default arguments domain <- domain %||% attr(.df, "_xportr.df_arg_") if (!is.null(domain)) attr(.df, "_xportr.df_arg_") <- domain ## End of common section assert_data_frame(.df) assert_metadata(metadata, include_fun_message = FALSE, null.ok = TRUE) assert_string(domain, null.ok = TRUE) assert_choice(verbose, choices = .internal_verbose_choices, null.ok = TRUE) structure(.df, `_xportr.df_metadata_` = metadata, `_xportr.df_verbose_` = verbose ) }
/scratch/gouwar.j/cran-all/cranData/xportr/R/metadata.R
#' Get or set xportr options #' #' @description #' #' There are two mechanisms for working with options for xportr. One is the #' [options()] function, which is part of base R, and the other is the #' `xportr_options()` function, which is in the xportr package. The reason for #' these two mechanisms is has to do with legacy code and scoping. #' #' The [options()] function sets options globally, for the duration of the R #' process. The [getOption()] function retrieves the value of an option. All #' xportr related options of this type are prefixed with `"xportr."`. #' #' #' @section Options with `options()`: #' #' \describe{ #' \item{xportr.df_domain_name}{defaults to `"dataset"`}: #' The name of the domain "name" column in dataset metadata. #' \item{xportr.df_label}{defaults to `"label"`}: #' The column noting the dataset label in dataset metadata. #' \item{xportr.domain_name}{defaults to `"dataset"`}: #' The name of the domain "name" column in variable metadata. #' \item{xportr.variable_name}{defaults to `"variable"`}: #' The name of the variable "name" in variable metadata. #' \item{xportr.type_name}{defaults to `"type"`}: #' The name of the variable type column in variable metadata. #' \item{xportr.label}{defaults to `"label"`}: #' The name of the variable label column in variable metadata. #' \item{xportr.length}{defaults to `"length"`}: #' The name of the variable length column in variable metadata. #' \item{xportr.order_name}{defaults to `"order"`}: #' The name of the variable order column in variable metadata. #' \item{xportr.format_name}{defaults to `"format"`}: #' The name of the variable format column in variable metadata. #' \item{xportr.format_verbose}{defaults to `"none"`}: #' The default argument for the 'verbose' argument for `xportr_format`. #' \item{xportr.label_verbose}{defaults to `"none"`}: #' The default argument for the 'verbose' argument for `xportr_label`. #' \item{xportr.length_verbose}{defaults to `"none"`}: #' The default argument for the 'verbose' argument for `xportr_length`. #' \item{xportr.type_verbose}{defaults to `"label"`}: #' The default argument for the 'verbose' argument for `xportr_type`. #' \item{xportr.character_types}{defaults to `"character"`}: #' The default character vector used to explicitly coerce R classes to character XPT types. #' \item{xportr.character_metadata_types}{defaults to `c("character", "char", "text", "date", "posixct", "posixt", #' "datetime", "time", "partialdate", "partialtime", "partialdatetime", #' "incompletedatetime", "durationdatetime", "intervaldatetime")`}: #' The default character vector used to explicitly coerce R classes to character XPT types. #' \item{xportr.numeric_metadata_types}{defaults to `c("integer", "numeric", "num", "float")`}: #' The default character vector used to explicitly coerce R classes to numeric XPT types. #' \item{xportr.numeric_types}{defaults to `c("integer", "float", "numeric", "posixct", "posixt", "time", "date")`}: #' The default character vector used to explicitly coerce R classes to numeric XPT types. #' } #' #' @section Options with `xportr_options()`: #' #' Alternative to the `options()`, the `xportr_options()` function can be used to set the options. #' The `xportr_options()` function also returns the current options when a character vector of #' the options keys are passed into it. If nothing is passed into it, it returns the state of all xportr options. #' #' @param ... Options to set, with the form `name = value` or a character vector of option names. #' #' @examples #' xportr_options("xportr.df_label") #' xportr_options(xportr.df_label = "data_label", xportr.label = "custom_label") #' xportr_options(c("xportr.label", "xportr.df_label")) #' xportr_options() #' @export xportr_options <- function(...) { checkmate::assert_subset(names(list(...)), names(xportr_options_list)) if (is.null(names(list(...)))) { if (length(list(...)) == 0) { queried_options <- names(xportr_options_list) } else { queried_options <- intersect(c(...), names(xportr_options_list)) } current_options <- lapply(queried_options, function(opt) { getOption(opt) }) names(current_options) <- queried_options return(current_options) } if (length(list(...)) > 0) { options_list <- list(...) xportr_options <- grep("^xportr\\.", names(options_list), value = TRUE) for (opt in xportr_options) { option_value <- options_list[[opt]] do.call(options, stats::setNames(list(option_value), opt)) } } }
/scratch/gouwar.j/cran-all/cranData/xportr/R/options.R
#' Order variables of a dataset according to Spec #' #' The `dplyr::arrange()` function is used to order the columns of the dataframe. #' Any variables that are missing an order value are appended to the end of the dataframe #' after all of the variables that have an order. #' #' @inheritParams xportr_length #' #' @export #' #' @section Messaging: `var_ord_msg()` is the primary messaging tool for #' `xportr_order()`. There are two primary messages that are output from #' `var_ord_msg()`. The first is the "moved" variables. These are the variables #' that were not found in the metadata file and moved to the end of the #' dataset. A message will be generated noting the number, if any, of #' variables that were moved to the end of the dataset. If any variables were #' moved, and the 'verbose' argument is 'stop', 'warn', or 'message', a #' message will be generated detailing the variables that were moved. #' #' The second primary message is the number of variables that were in the #' dataset, but not in the correct order. A message will be generated noting #' the number, if any, of variables that have been reordered. If any variables #' were reordered, and the 'verbose' argument is 'stop', 'warn', or 'message', #' a message will be generated detailing the variables that were reordered. #' #' @section Metadata: The argument passed in the 'metadata' argument can either #' be a metacore object, or a data.frame containing the data listed below. If #' metacore is used, no changes to options are required. #' #' For data.frame 'metadata' arguments three columns must be present: #' #' 1) Domain Name - passed as the 'xportr.domain_name' option. Default: #' "dataset". This is the column subset by the 'domain' argument in the #' function. #' #' 2) Variable Name - passed as the 'xportr.variable_name' option. #' Default: "variable". This is used to match columns in '.df' argument and #' the metadata. #' #' 3) Variable Order - passed as the 'xportr.order_name' option. #' Default: "order". These values used to arrange the order of the variables. #' If the values of order metadata are not numeric, they will be coerced to #' prevent alphabetical sorting of numeric values. #' #' @return Dataframe that has been re-ordered according to spec #' #' @examples #' adsl <- data.frame( #' BRTHDT = c(1, 1, 2), #' STUDYID = c("mid987650", "mid987650", "mid987650"), #' TRT01A = c("Active", "Active", "Placebo"), #' USUBJID = c(1001, 1002, 1003) #' ) #' #' metadata <- data.frame( #' dataset = c("adsl", "adsl", "adsl", "adsl"), #' variable = c("STUDYID", "USUBJID", "TRT01A", "BRTHDT"), #' order = 1:4 #' ) #' #' adsl <- xportr_order(adsl, metadata, domain = "adsl") xportr_order <- function(.df, metadata = NULL, domain = NULL, verbose = NULL, metacore = deprecated()) { if (!missing(metacore)) { lifecycle::deprecate_stop( when = "0.3.1.9005", what = "xportr_order(metacore = )", with = "xportr_order(metadata = )" ) } ## Common section to detect default arguments domain <- domain %||% attr(.df, "_xportr.df_arg_") if (!is.null(domain)) attr(.df, "_xportr.df_arg_") <- domain metadata <- metadata %||% attr(.df, "_xportr.df_metadata_") # Verbose should use an explicit verbose option first, then the value set in # metadata, and finally fall back to the option value verbose <- verbose %||% attr(.df, "_xportr.df_verbose_") %||% getOption("xportr.order_verbose", "none") ## End of common section assert_data_frame(.df) assert_string(domain, null.ok = TRUE) assert_metadata(metadata) assert_choice(verbose, choices = .internal_verbose_choices) domain_name <- getOption("xportr.domain_name") order_name <- getOption("xportr.order_name") variable_name <- getOption("xportr.variable_name") if (inherits(metadata, "Metacore")) metadata <- metadata$ds_vars if (domain_name %in% names(metadata) && !is.null(domain)) { metadata <- metadata %>% dplyr::filter(!!sym(domain_name) == .env$domain & !is.na(!!sym(order_name))) } else { metadata <- metadata %>% dplyr::filter(!is.na(!!sym(order_name))) # Common check for multiple variables name check_multiple_var_specs(metadata, variable_name) } # Grabs vars from Spec and inputted dataset vars_in_spec_ds <- metadata[, c(variable_name, order_name)] %>% mutate(!!sym(order_name) := as.numeric(!!sym(order_name))) %>% arrange(!!sym(order_name)) %>% extract2(variable_name) vars_in_spec_ds <- vars_in_spec_ds[!is.na(vars_in_spec_ds)] # Grabs all variables from Spec file and orders accordingly ord_vars <- .df %>% select(any_of(vars_in_spec_ds)) # Variables not in Spec file - will be moved to the end drop_vars <- .df %>% select(!any_of(vars_in_spec_ds)) df_re_ord <- bind_cols(ord_vars, drop_vars) # Used in warning message for how many vars have been moved reorder_vars <- names(df_re_ord)[names(df_re_ord) != names(.df)] # Function is located in messages.R var_ord_msg(reorder_vars, names(drop_vars), verbose) df_re_ord }
/scratch/gouwar.j/cran-all/cranData/xportr/R/order.R
#' Split xpt file output #' #' Per the FDA Study Data Technical Conformance #' Guide(https://www.fda.gov/media/88173/download) section 3.3.2, dataset files #' sizes shouldn't exceed 5 GB. If datasets are large enough, they should be #' split based on a variable. For example, laboratory readings in `ADLB` can be #' split by `LBCAT` to split up hematology and chemistry data. #' #' This function will tell `xportr_write()` to split the data frame based on the #' variable passed in `split_by`. When written, the file name will be prepended #' with a number for uniqueness. These files should be noted in the Reviewer Guides per #' CDISC guidance to note how you split your files. #' #' @inheritParams xportr_length #' @param split_by A quoted variable that will be passed to `base::split()`. #' #' @return A data frame with an additional attribute added so `xportr_write()` #' knows how to split the data frame. #' #' #' @export #' #' @examples #' #' adlb <- data.frame( #' USUBJID = c(1001, 1002, 1003), #' LBCAT = c("HEMATOLOGY", "HEMATOLOGY", "CHEMISTRY") #' ) #' #' adlb <- xportr_split(adlb, "LBCAT") xportr_split <- function(.df, split_by = NULL) { attr(.df, "_xportr.split_by_") <- split_by return(.df) }
/scratch/gouwar.j/cran-all/cranData/xportr/R/split.R
#' Custom expect function to test result of xportr_length #' #' @param result data.frame with `width` attribute on its columns. #' @param metadata_length vector of numeric with expected lengths for each #' column width. #' #' @return The first argument, invisibly. #' @keywords internal expect_attr_width <- function(result, metadata_length) { test_widths <- map( colnames(result), ~ attributes(result[[.x]]) %>% pluck("width") ) %>% unlist() == metadata_length test_widths %>% all() %>% testthat::expect_true() invisible(result) } #' Minimal data frame mock of a valid ADaM dataset #' #' This function is only used in tests. #' #' @param n_rows Numeric value that indicates the number of rows of the data #' frame #' @param cols Vector of characters that indicates which columns to return. #' By default only `x` and `y` are returned with numeric contents. #' #' @return A data.frame mimicking a valid ADaM dataset. #' @keywords internal minimal_table <- function(n_rows = 3, cols = c("x", "y")) { data.frame( x = sample(1000 + seq(n_rows * 100), size = n_rows), y = sample(c(0, 1, 2), size = n_rows, replace = TRUE), z = 3, a = 4, b = sample( c("Recusandae", "vero", "nihil", "velit", "omnis"), size = n_rows, replace = TRUE ), c = sample( Sys.time() - 3600 * c(1, 10, 100, 1000), size = n_rows, replace = TRUE ), d = sample(Sys.Date() + c(1, -1, 10, -10), size = n_rows, replace = TRUE), e = sample(c(1, 2), replace = TRUE, size = n_rows) ) %>% mutate(e = if_else(seq_along(.data$e) %% 2 == 0, NA, .data$e)) %>% select(all_of(tolower(cols))) } #' Minimal metadata data frame mock for a ADaM dataset #' #' @param dataset Flag that indicates that the `dataset` column should #' be included. #' @param length Flag that indicates that the `length` column should #' be included. #' @param label Flag that indicates that the `label` column should #' be included. #' @param type Flag that indicates that the `type` column should #' be included. #' @param format Flag that indicates that the `format` column should #' be included. #' @param order Flag that indicates that the `order` column should #' be included. #' @param dataset_name String with name of domain. #' @param var_names Character vector that defines which variables (rows) #' to keep #' #' @return A metadata data.frame #' @keywords internal minimal_metadata <- function(dataset = FALSE, length = FALSE, label = FALSE, type = FALSE, format = FALSE, order = FALSE, dataset_name = "adsl", var_names = NULL) { cols_logical <- c(dataset, TRUE, label, length, type, format, order) cols <- c( "dataset", "variable", "label", "length", "type", "format", "order" )[cols_logical] metadata <- tribble( ~dataset, ~variable, ~label, ~length, ~type, ~format, ~order, "adsl", "x", "Lorem", 8, "numeric", NA, 1, "adsl", "y", "Ipsum", 200, "numeric", NA, 2, "adsl", "z", "Dolor", 8, "numeric", NA, 3, "adsl", "a", "Sit", 8, "numeric", NA, 4, "adsl", "b", "Amet", 200, "character", NA, 5, "adsl", "c", "Consectetur", 200, "character", "datetime20.", 6, "adsl", "d", "Adipiscing", 200, "date", "date9.", 7 ) if (!is.null(var_names)) { metadata <- metadata %>% filter(.data$variable %in% var_names) } metadata %>% select(all_of(cols)) } #' Local function to remove extra spaces and format by cli #' #' Groups together multiple calls instead of being spread out in code #' #' @param `[environment(1)]`\cr Attach exit handlers to this environment. Typically, this should #' be either the current environment or a parent frame #' (accessed through parent.frame()). #' @noRd #' @keywords internal local_cli_theme <- function(.local_envir = parent.frame()) { cli_theme_tests <- list( h2 = list(`margin-top` = 0, `margin-bottom` = 0, fmt = function(x) x), h1 = list(`margin-top` = 0, `margin-bottom` = 0, fmt = function(x) x), `.alert` = list(before = NULL), `.alert-danger` = list(before = NULL), `.alert-success` = list(before = NULL) ) # Use rlang::local_options instead of withr (Suggest package) local_options(cli.user_theme = cli_theme_tests, .frame = .local_envir) app <- cli::start_app(output = "message", .auto_close = FALSE, .envir = .local_envir) if (requireNamespace("withr", quietly = TRUE)) { withr::local_envvar(NO_COLOR = "yes", .frame = .local_envir) withr::defer(cli::stop_app(app), envir = .local_envir) } } #' Test if multiple vars in spec will result in warning message #' @keywords internal multiple_vars_in_spec_helper <- function(fun) { adsl <- minimal_table(30) metadata <- minimal_metadata( dataset = TRUE, order = TRUE, length = TRUE, type = TRUE, format = TRUE, label = TRUE, var_names = colnames(adsl) ) metadata <- metadata %>% mutate(dataset = "adtte") %>% dplyr::bind_rows(metadata) %>% dplyr::rename(Dataset = "dataset") local_options(xportr.length_verbose = "message") # Setup temporary options with active verbose and Remove empty lines in cli theme local_cli_theme() adsl %>% fun(metadata, "adsl") %>% testthat::expect_message("There are multiple specs for the same variable name") } #' Test if multiple vars in spec with appropriate #' @keywords internal multiple_vars_in_spec_helper2 <- function(fun) { adsl <- minimal_table(30) metadata <- minimal_metadata( dataset = TRUE, order = TRUE, length = TRUE, type = TRUE, format = TRUE, label = TRUE, var_names = colnames(adsl) ) metadata <- metadata %>% mutate(dataset = "adtte") %>% dplyr::bind_rows(metadata) %>% dplyr::rename(Dataset = "dataset") local_options(xportr.length_verbose = "message", xportr.domain_name = "Dataset") # Setup temporary options with active verbose and Remove empty lines in cli theme local_cli_theme() adsl %>% xportr_metadata(domain = "adsl") %>% fun(metadata, "adsl") %>% testthat::expect_no_message(message = "There are multiple specs for the same variable name") }
/scratch/gouwar.j/cran-all/cranData/xportr/R/support-test.R
#' Coerce variable type #' #' XPT v5 datasets only have data types of character and numeric. `xportr_type` #' attempts to collapse R classes to those two XPT types. The #' 'xportr.character_types' option is used to explicitly collapse the class of a #' column to character using `as.character`. Similarly, 'xportr.numeric_types' #' will collapse a column to a numeric type. If no type is passed for a #' variable, it is assumed to be numeric and coerced with `as.numeric()`. #' #' Certain care should be taken when using timing variables. R serializes dates #' based on a reference date of 01/01/1970 where XPT uses 01/01/1960. This can #' result in dates being 10 years off when outputting from R to XPT if you're #' using a date class. For this reason, `xportr` will try to determine what #' should happen with variables that appear to be used to denote time. #' #' @inheritParams xportr_length #' #' @section Messaging: `type_log()` is the primary messaging tool for #' `xportr_type()`. The number of column types that mismatch the reported type #' in the metadata, if any, is reported by by `xportr_type()`. If there are any #' type mismatches, and the 'verbose' argument is 'stop', 'warn', or #' 'message', each mismatch will be detailed with the actual type in the data #' and the type noted in the metadata. #' #' @section Metadata: The argument passed in the 'metadata' argument can either #' be a metacore object, or a data.frame containing the data listed below. If #' metacore is used, no changes to options are required. #' #' For data.frame 'metadata' arguments four columns must be present: #' #' 1) Domain Name - passed as the 'xportr.domain_name' option. Default: #' "dataset". This is the column subset by the 'domain' argument in the #' function. #' #' 2) Variable Name - passed as the 'xportr.variable_name' option. Default: #' "variable". This is used to match columns in '.df' argument and the #' metadata. #' #' 3) Variable Type - passed as the 'xportr.type_name'. Default: "type". This #' is used to note the XPT variable "type" options are numeric or character. #' #' 4) (Option only) Character Types - The list of classes that should be #' explicitly coerced to a XPT Character type. Default: c( "character", #' "char", "text", "date", "posixct", "posixt", "datetime", "time", #' "partialdate", "partialtime", "partialdatetime", "incompletedatetime", #' "durationdatetime", "intervaldatetime")` #' #' 5) (Option only) Numeric Types - The list of classes that should be #' explicitly coerced to a XPT numeric type. Default: c("integer", "numeric", #' "num", "float") #' #' @return Returns the modified table. #' @export #' #' @examples #' metadata <- data.frame( #' dataset = "test", #' variable = c("Subj", "Param", "Val", "NotUsed"), #' type = c("numeric", "character", "numeric", "character") #' ) #' #' .df <- data.frame( #' Subj = as.character(123, 456, 789), #' Different = c("a", "b", "c"), #' Val = c("1", "2", "3"), #' Param = c("param1", "param2", "param3") #' ) #' #' df2 <- xportr_type(.df, metadata, "test") xportr_type <- function(.df, metadata = NULL, domain = NULL, verbose = NULL, metacore = deprecated()) { if (!missing(metacore)) { lifecycle::deprecate_stop( when = "0.3.1.9005", what = "xportr_type(metacore = )", with = "xportr_type(metadata = )" ) } ## Common section to detect default arguments domain <- domain %||% attr(.df, "_xportr.df_arg_") if (!is.null(domain)) attr(.df, "_xportr.df_arg_") <- domain metadata <- metadata %||% attr(.df, "_xportr.df_metadata_") # Verbose should use an explicit verbose option first, then the value set in # metadata, and finally fall back to the option value verbose <- verbose %||% attr(.df, "_xportr.df_verbose_") %||% getOption("xportr.type_verbose", "none") ## End of common section assert_data_frame(.df) assert_string(domain, null.ok = TRUE) assert_metadata(metadata) assert_choice(verbose, choices = .internal_verbose_choices) # Name of the columns for working with metadata domain_name <- getOption("xportr.domain_name") variable_name <- getOption("xportr.variable_name") type_name <- getOption("xportr.type_name") character_types <- c(getOption("xportr.character_types"), "_character") character_metadata_types <- c(getOption("xportr.character_metadata_types"), "_character") numeric_metadata_types <- c(getOption("xportr.numeric_metadata_types"), "_numeric") numeric_types <- c(getOption("xportr.numeric_types"), "_numeric") if (inherits(metadata, "Metacore")) metadata <- metadata$var_spec if (domain_name %in% names(metadata) && !is.null(domain)) { metadata <- metadata %>% filter(!!sym(domain_name) == .env$domain) } metacore <- metadata %>% select(!!sym(variable_name), !!sym(type_name)) # Common check for multiple variables name check_multiple_var_specs(metadata, variable_name) # Current class of table variables table_cols_types <- map(.df, first_class) # Produces a data.frame with Variables, Type.x(Table), and Type.y(metadata) meta_ordered <- left_join( data.frame(variable = names(.df), type = unlist(table_cols_types)), metadata, by = "variable" ) %>% mutate( # _character is used here as a mask of character, in case someone doesn't # want 'character' coerced to character type.x = if_else(type.x %in% character_types, "_character", type.x), type.x = if_else(type.x %in% numeric_types, "_numeric", type.x ), type.y = if_else(is.na(type.y), type.x, type.y), type.y = tolower(type.y), type.y = if_else(type.y %in% character_metadata_types, "_character", type.y), type.y = if_else(type.y %in% numeric_metadata_types, "_numeric", type.y) ) # It is possible that a variable exists in the table that isn't in the metadata # it will be silently ignored here. This may happen depending on what a user # passes and the options they choose. The check_core function is the place # where this should be caught. type_mismatch_ind <- which(meta_ordered$type.x != meta_ordered$type.y) type_log(meta_ordered, type_mismatch_ind, verbose) # Check if variable types match is_correct <- vapply(meta_ordered[["type.x"]] == meta_ordered[["type.y"]], isTRUE, logical(1)) # Use the original variable iff metadata is missing that variable correct_type <- ifelse(is.na(meta_ordered[["type.y"]]), meta_ordered[["type.x"]], meta_ordered[["type.y"]]) # Walk along the columns and coerce the variables. Modifying the columns # Directly instead of something like map_dfc to preserve any attributes. iwalk( correct_type, function(x, i, is_correct) { if (!is_correct[i]) { orig_attributes <- attributes(.df[[i]]) orig_attributes$class <- NULL orig_attributes$levels <- NULL if (correct_type[i] %in% character_types) { .df[[i]] <<- as.character(.df[[i]]) } else { .df[[i]] <<- as.numeric(.df[[i]]) } attributes(.df[[i]]) <<- orig_attributes } }, is_correct ) .df }
/scratch/gouwar.j/cran-all/cranData/xportr/R/type.R
#' Extract Attribute From Data #' #' @param data Dataset to be exported as xpt file #' @param attr SAS attributes such as label, format, type #' #' @return Character vector of attributes with column names assigned #' @noRd extract_attr <- function(data, attr = c("label", "format.sas")) { attr <- match.arg(attr) out <- lapply(data, function(.x) attr(.x, attr)) out <- vapply(out, function(.x) ifelse(is.null(.x), "", .x), character(1L), USE.NAMES = FALSE ) names(out) <- names(data) out } #' Assign Plural Grammar to Strings #' #' @param n Numeric value, usually the length of a character vector #' @param msg1 Character value, usually a noun in singular form, such as Variable #' @param msg2 Character value, usually a noun in plural form, such as Variables #' #' @return Singular or plural form of a word #' @noRd ntext <- function(n, msg1, msg2) { if (n == 1) msg1 else msg2 } #' Assign Commas and Oxford Comma to a Series of Words in Text #' #' @param x Character Vector, usually a series of column names #' #' @return String of text where words are separated by commas and final #' oxford comma ", and" convention #' @noRd fmt_comma <- function(x) { glue_collapse(x, sep = ", ", last = if (length(x) <= 2) " and " else ", and ") } #' Encode String of Variables in Tick Marks #' #' @param x Character Vector, of Variables #' #' @return String of text where series of words encased in ticks are separated by #' commas and final oxford comma ", and" convention #' @noRd encode_vars <- function(x) { if (is.character(x)) { x <- encodeString(x, quote = "`") } fmt_comma(x) } #' Encode String of Values in Quotation Marks #' #' @param x Character Vector, of Values #' #' @return String of text where series of words encased in quotation marks are #' separated by commas and final oxford comma ", and" convention #' @noRd encode_vals <- function(x) { if (is.character(x)) { x <- encodeString(x, quote = "'") } fmt_comma(x) } #' Variables Types Error Message Helper Function #' #' @param x Character vector of variable names #' #' @return String of text to append error message #' @noRd fmt_vars <- function(x) { vars <- ntext(length(x), "Variable", "Variables") glue("{vars} {encode_vars(x)}") } #' Variables Labels Error Message Helper Function #' #' @param x Character vector of variable labels #' #' @return String of text to append error message #' @noRd fmt_labs <- function(x) { labs <- ntext(length(x), "Label", "Labels") val <- paste0(names(x), "=", unname(x)) glue("{labs} {encode_vals(val)}") } #' Variables Formats Error Message Helper Function #' #' @param x Character vector of variable formats #' #' @return String of text to append error message #' @noRd fmt_fmts <- function(x) { fmts <- ntext(length(x), "Format", "Formats") glue("{fmts} {encode_vals(x)}") } #' Check Variable Names Before Exporting to xpt #' #' @param varnames Column names of data #' #' @param list_vars_first Logical value to toggle where to list out column names #' in error message #' #' @param err_cnd Character vector to initialize message #' #' @details Prior to exporting xpt file, check that column names meet appropriate #' conditions like character limits, capitalization, and other naming conventions. #' #' @return An error message if incompatible variable names were used. #' @noRd xpt_validate_var_names <- function(varnames, list_vars_first = TRUE, err_cnd = character()) { # 1.1 Check length -- chk_varlen <- varnames[nchar(varnames) > 8] if (length(chk_varlen) > 0) { err_cnd <- c(err_cnd, ifelse(list_vars_first, glue("{fmt_vars(chk_varlen)} must be 8 characters or less."), glue(" Must be 8 characters or less: {fmt_vars(chk_varlen)}.") )) } # 1.2 Check first character -- chk_first_chr <- varnames[stringr::str_detect( stringr::str_sub(varnames, 1, 1), "[^[:alpha:]]" )] if (length(chk_first_chr) > 0) { err_cnd <- c(err_cnd, ifelse(list_vars_first, glue("{fmt_vars(chk_first_chr)} must start with a letter."), glue(" Must start with a letter: {fmt_vars(chk_first_chr)}.") )) } # 1.3 Check Non-ASCII and underscore characters -- chk_alnum <- varnames[stringr::str_detect(varnames, "[^a-zA-Z0-9]")] if (length(chk_alnum) > 0) { err_cnd <- c(err_cnd, ifelse(list_vars_first, glue("{fmt_vars(chk_alnum)} cannot contain any non-ASCII, symbol or underscore characters."), glue(" Cannot contain any non-ASCII, symbol or underscore characters: {fmt_vars(chk_alnum)}.") )) } # 1.4 Check for any lowercase letters - or not all uppercase chk_lower <- varnames[!stringr::str_detect( stringr::str_replace_all(varnames, "[:digit:]", ""), "^[[:upper:]]+$" )] if (length(chk_lower) > 0) { err_cnd <- c(err_cnd, ifelse(list_vars_first, glue("{fmt_vars(chk_lower)} cannot contain any lowercase characters."), glue(" Cannot contain any lowercase characters {fmt_vars(chk_lower)}.") )) } return(err_cnd) } #' Internal list of formats to check #' @noRd .internal_format_list <- c( NA, "", paste("$", 1:200, ".", sep = ""), paste("date", 5:11, ".", sep = ""), paste("time", 2:20, ".", sep = ""), paste("datetime", 7:40, ".", sep = ""), paste("yymmdd", 2:10, ".", sep = ""), paste("mmddyy", 2:10, ".", sep = ""), paste("ddmmyy", 2:10, ".", sep = ""), "E8601DA.", "E8601DA10.", "E8601DN.", "E8601DN10.", "E8601TM.", paste("E8601TM", 8:15, ".", sep = ""), paste("E8601TM", 8:15, ".", sort(rep(0:6, 8)), sep = ""), "E8601TZ.", paste("E8601TZ", 9:20, ".", sep = ""), paste("E8601TZ", 9:20, ".", sort(rep(0:6, 12)), sep = ""), "E8601TX.", paste("E8601TX", 9:20, ".", sep = ""), "E8601DT.", paste("E8601DT", 16:26, ".", sep = ""), paste("E8601DT", 16:26, ".", sort(rep(0:6, 11)), sep = ""), "E8601LX.", paste("E8601LX", 20:35, ".", sep = ""), "E8601LZ.", paste("E8601LZ", 9:20, ".", sep = ""), "E8601DX.", paste("E8601DX", 20:35, ".", sep = ""), "B8601DT.", paste("B8601DT", 15:26, ".", sep = ""), paste("B8601DT", 15:26, ".", sort(rep(0:6, 12)), sep = ""), "IS8601DA.", "B8601DA.", paste("B8601DA", 8:10, ".", sep = ""), "weekdate.", paste("weekdate", 3:37, ".", sep = ""), "mmddyy.", "ddmmyy.", "yymmdd.", "date.", "time.", "hhmm.", "IS8601TM.", "E8601TM.", "B8601TM." ) #' Internal regex for format w.d #' @noRd .internal_format_regex <- paste( sep = "|", "^([1-9]|[12][0-9]|3[0-2])\\.$", "^([1-9]|[12][0-9]|3[0-2])\\.([1-9]|[12][0-9]|3[0-1])$" ) #' Validate Dataset Can be Written to xpt #' #' Function used to validate dataframes before they are sent to #' `haven::write_xpt` for writing. #' #' @param data Dataset to be exported as xpt file #' #' @return Returns a character vector of failed conditions #' #' @export xpt_validate <- function(data) { assert_data_frame(data) err_cnd <- character() # 1.0 VARIABLES ---- varnames <- names(data) err_cnd <- xpt_validate_var_names(varnames = varnames, err_cnd = err_cnd) # 2.0 LABELS ---- labels <- extract_attr(data, attr = "label") # 2.1 Check length -- chk_label_len <- labels[nchar(labels) > 40] if (length(chk_label_len) > 0) { err_cnd <- c( err_cnd, glue("{fmt_labs(chk_label_len)} must be 40 characters or less.") ) } # 2.2 Check Non-ASCII and special characters chk_spl_chr <- labels[stringr::str_detect(labels, "[^[:ascii:]]")] if (length(chk_spl_chr) > 0) { err_cnd <- c( err_cnd, glue("{fmt_labs(chk_spl_chr)} cannot contain any non-ASCII, symbol or special characters.") ) } # 3.0 Format Types ---- formats <- extract_attr(data, attr = "format.sas") ## The usual expected formats in clinical trials: characters, dates # Formats: https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/leforinforref/n0zwce550r32van1fdd5yoixrk4d.htm expected_formats <- .internal_format_list format_regex <- .internal_format_regex # 3.1 Invalid types is_valid <- toupper(formats) %in% toupper(expected_formats) | purrr::map_lgl(formats, stringr::str_detect, format_regex) chk_formats <- formats[!is_valid] ## Remove the correctly numerically formatted variables if (length(chk_formats) > 0) { err_cnd <- c( err_cnd, glue("{fmt_fmts(names(chk_formats))} must have a valid format.") ) } # 4.0 max length of Character variables <= 200 bytes max_nchar <- data %>% summarize(across(where(is.character), ~ max(0L, nchar(., type = "bytes"), na.rm = TRUE))) nchar_gt_200 <- max_nchar[which(max_nchar > 200)] if (length(nchar_gt_200) > 0) { err_cnd <- c( err_cnd, glue("Length of {names(nchar_gt_200)} must be 200 bytes or less.") ) } return(err_cnd) } #' Get Origin Object of a Series of Pipes #' #' @return The R Object at the top of a pipe stack #' @noRd get_pipe_call <- function() { call_strs <- map(as.list(sys.calls()), ~ deparse1(.x, nlines = 1)) top_call <- max(which(str_detect(call_strs, "%>%"))) call_str <- call_strs[[top_call]] trimws(strsplit(call_str, "%>%", fixed = TRUE)[[1]][[1]]) } #' Helper function to get the first class attribute #' #' @param x Any vector #' #' @return "character" or class of vector #' @noRd first_class <- function(x) { character_types <- getOption("xportr.character_types") class_ <- tolower(class(x)[1]) if (class_ %in% character_types) { "character" } else { class_ } } #' Check for multiple var name specs #' #' Detects cases where the domain name is not correctly defined and the full #' specification is used. #' This can lead to multiple warnings for the same variable. For instance, in #' the FDA pilot 3 submission the column has variable name with uppercase #' `Variable`, where the defaults for xportr is for lowercase `variable`. #' #' @param metadata A data frame containing variable level metadata. #' @param variable_name string with `getOption('xportr.variable_name')` #' @noRd check_multiple_var_specs <- function(metadata, variable_name = getOption("xportr.variable_name")) { variable_len <- pluck(metadata, variable_name) %||% c() if (NROW(variable_len) != NROW(unique(variable_len))) { cli_alert_info( glue( .sep = " ", "There are multiple specs for the same variable name.", "Check the metadata and variable name option", "`getOption('xportr.variable_name')`" ) ) } } #' Calculate the maximum length of variables #' #' Function to calculate the maximum length of variables in a given dataframe #' #' @inheritParams xportr_length #' #' @return Returns a dataframe with variables and their maximum length #' #' @noRd variable_max_length <- function(.df) { assert_data_frame(.df) variable_length <- getOption("xportr.length") variable_name <- getOption("xportr.variable_name") max_nchar <- .df %>% summarize(across(where(is.character), ~ max(0L, nchar(., type = "bytes"), na.rm = TRUE))) xport_max_length <- data.frame() col <- 0 for (var in names(.df)) { col <- col + 1 xport_max_length[col, variable_name] <- var if (is.character(.df[[var]])) { xport_max_length[col, variable_length] <- max_nchar[var] } else { xport_max_length[col, variable_length] <- 8 } } return(xport_max_length) } #' Custom check for metadata object #' #' Improvement on the message clarity over the default assert(...) messages. #' @noRd #' @param metadata A data frame or `Metacore` object containing variable level #' @inheritParams checkmate::check_logical #' metadata. check_metadata <- function(metadata, include_fun_message, null.ok = FALSE) { # nolint: object_name. if (is.null(metadata) && null.ok) { return(TRUE) } extra_string <- ", 'Metacore' or set via 'xportr_metadata()'" if (!include_fun_message) { extra_string <- " or 'Metacore'" } if (!inherits(metadata, "Metacore") && !test_data_frame(metadata)) { return( glue( "Must be of type 'data.frame'{extra_string},", " not `{paste(class(metadata), collapse = '/')}" ) ) } TRUE } #' Custom assertion for metadata object #' @noRd #' @param metadata A data frame or `Metacore` object containing variable level #' @inheritParams checkmate::check_logical #' metadata. assert_metadata <- function(metadata, include_fun_message = TRUE, null.ok = FALSE, # nolint: object_name. add = NULL, .var.name = vname(metadata)) { # nolint: object_name. makeAssertion( metadata, check_metadata(metadata, include_fun_message, null.ok), var.name = .var.name, collection = add ) } #' Internal choices for verbose option #' @noRd .internal_verbose_choices <- c("none", "warn", "message", "stop") #' Internal function to check xpt file size #' @noRd check_xpt_size <- function(path) { fs <- file.size(path) fs_string <- c( "i" = paste0("xpt file size is: ", round(fs / 1e+9, 2)), " GB.", "x" = paste0( "XPT file sizes should not exceed 5G. It is", " recommended you call `xportr_split` to split the file into smaller files." ) ) if (fs > 5e+9) { cli_warn(fs_string, class = "xportr.xpt_size") # nocov } invisible(NULL) }
/scratch/gouwar.j/cran-all/cranData/xportr/R/utils-xportr.R
#' Write xpt v5 transport file #' #' Writes a local data frame into SAS transport file of version 5. The SAS #' transport format is an open format, as is required for submission of the data #' to the FDA. #' #' @param .df A data frame to write. #' @param path Path where transport file will be written. File name sans will be #' used as `xpt` name. #' @param label `r lifecycle::badge("deprecated")` Previously used to to set the Dataset label. #' Use the `metadata` argument to set the dataset label. #' @param strict_checks If TRUE, xpt validation will report errors and not write #' out the dataset. If FALSE, xpt validation will report warnings and continue #' with writing out the dataset. Defaults to FALSE #' @inheritParams xportr_df_label #' @inheritSection xportr_df_label Metadata #' #' @details #' * Variable and dataset labels are stored in the "label" attribute. #' #' * SAS format are stored in the "SASformat" attribute. #' #' * SAS type are based on the `metadata` attribute. #' #' @return A data frame. `xportr_write()` returns the input data invisibly. #' @export #' #' @examples #' adsl <- data.frame( #' SUBL = as.character(123, 456, 789), #' DIFF = c("a", "b", "c"), #' VAL = c("1", "2", "3"), #' PARAM = c("param1", "param2", "param3") #' ) #' #' var_spec <- data.frame( #' dataset = "adsl", #' label = "Subject-Level Analysis Dataset", #' data_label = "ADSL" #' ) #' xportr_write(adsl, #' path = paste0(tempdir(), "/adsl.xpt"), #' domain = "adsl", #' metadata = var_spec, #' strict_checks = FALSE #' ) #' xportr_write <- function(.df, path, metadata = NULL, domain = NULL, strict_checks = FALSE, label = deprecated()) { if (!missing(label)) { lifecycle::deprecate_warn( when = "0.3.2", what = "xportr_write(label = )", with = "xportr_write(metadata = )" ) assert_string(label, null.ok = TRUE, max.chars = 40) metadata <- data.frame(dataset = domain, label = label) } ## Common section to detect default arguments domain <- domain %||% attr(.df, "_xportr.df_arg_") if (!is.null(domain)) attr(.df, "_xportr.df_arg_") <- domain # metadata should not be inferred from the data frame if it is not provided # by the user. ## End of common section assert_data_frame(.df) assert_string(path) assert_metadata(metadata, null.ok = TRUE) assert_logical(strict_checks) path <- normalizePath(path, mustWork = FALSE) name <- tools::file_path_sans_ext(basename(path)) if (!is.null(metadata)) { .df <- xportr_df_label(.df, metadata = metadata, domain = domain) } if (nchar(name) > 8) { assert(".df file name must be 8 characters or less.", .var.name = "path") } checks <- xpt_validate(.df) if (stringr::str_detect(name, "[^a-zA-Z0-9]")) { checks <- c(checks, "`.df` cannot contain any non-ASCII, symbol or underscore characters.") } if (length(checks) > 0) { if (!strict_checks) { warn(c("The following validation checks failed:", checks)) } else { abort(c("The following validation checks failed:", checks)) } } data <- as.data.frame(.df) tryCatch( { # If data is not split, data is just written out if (is.null(attr(data, "_xportr.split_by_"))) { write_xpt(data, path = path, version = 5, name = name) check_xpt_size(path) } else { # If data is split, perform the split and get an index for the for loop split_data <- split(data, data[[attr(data, "_xportr.split_by_")]]) split_index <- unique(data[[attr(data, "_xportr.split_by_")]]) paths <- get_split_path(path, seq_along(split_index)) # Iterate on the unique values of the split for (i in seq_along(split_index)) { # Write out the split data, `get_split_path` will determine file name write_xpt(split_data[[i]], path = paths[i], version = 5, name = name ) check_xpt_size(paths[i]) } } }, error = function(err) { abort( paste0( "Error reported by haven::write_xpt, error was: \n", err ) ) } ) invisible(data) } #' Figure out path for split data. #' #' Will append a number before the file extension to indicate the split. #' #' i.e. `adsl.xpt` will become `adsl1.xpt` and `adsl2.xpt` #' #' @param path Path variable specified by user #' @param ind Index of split variable #' #' @noRd get_split_path <- function(path, ind) { paste0( tools::file_path_sans_ext(path), ind, ".", tools::file_ext(path) ) }
/scratch/gouwar.j/cran-all/cranData/xportr/R/write.R
#' The `xportr` package #' #' `xportr` is designed to be a clinical workflow friendly method for outputting #' CDISC complaint data sets in R, to XPT version 5 files. It was designed with #' options in mind to allow for flexible setting of options while allowing #' projects and system administrators to set sensible defaults for their #' organizations workflows. Below are a list of options that can be set to #' customize how `xportr` works in your environment. #' #' @section xportr options: #' #' \itemize{ #' \item{ #' xportr.df_domain_name - The name of the domain "name" column in dataset #' metadata. Default: "dataset" #' } #' \item { #' xportr.df_label - The column noting the dataset label in dataset metadata. #' Default: "label" #' } #' \item{ #' xportr.domain_name - The name of the domain "name" column in variable #' metadata. Default: "dataset" #' } #' \item{ #' xportr.variable_name - The name of the variable "name" in variable #' metadata. Default: "variable" #' } #' \item{ #' xportr.type_name - The name of the variable type column in variable #' metadata. Default: "type" #' } #' \item{ #' xportr.label - The name of the variable label column in variable metadata. #' Default: "label" #' } #' \item{ #' xportr.length - The name of the variable length column in variable #' metadata. Default: "length" #' } #' \item{ #' xportr.order_name - The name of the variable order column in variable #' metadata. Default: "order" #' } #' \item{ #' xportr.format_name - The name of the variable format column in variable #' metadata. Default: "format" #' } #' \item{ #' xportr.format_verbose - The default argument for the 'verbose' argument for #' `xportr_format`. Default: "none" #' } #' \item{ #' xportr.label_verbose - The default argument for the 'verbose' argument for #' `xportr_label`. Default: "none" #' } #' \item{ #' xportr.length_verbose - The default argument for the 'verbose' argument for #' `xportr_length`. Default: "none" #' } #' \item{ #' xportr.type_verbose - The default argument for the 'verbose' argument for #' `xportr_type`. Default: "none" #' } #' \item{ #' xportr.character_types - The default character vector used to explicitly #' coerce R classes to character XPT types. Default: "character" #' } #' \item{ #' xportr.character_metadata_types - The default character vector used to explicitly #' coerce R classes to character XPT types. Default: c("character", "char", #' "text", "date", "posixct", "posixt", "datetime", "time", "partialdate", #' "partialtime", "partialdatetime", "incompletedatetime", "durationdatetime", #' "intervaldatetime")` #' } #' \item{ #' xportr.numeric_metadata_types - The default character vector used to explicitly #' coerce R classes to numeric XPT types. Default: c("integer", "numeric", "num", "float") #' } #' \item{ #' xportr.numeric_types - The default character vector used to explicitly #' coerce R classes to numeric XPT types. Default: c("integer", "float", #' "numeric", "posixct", "posixt", "time", "date") #' } #' } #' #' @section Updating Options: #' \itemize{ #' \item{For a single session, an option can be changed by #' `option(<optionToChange> = <NewValue>)`} #' \item{To change an option for a single projects across sessions in that #' projects, place the options update in the `.Rprofile` in that project #' directory.} #' \item{To change an option for a user across all sessions, place the options #' update in the `.Rprofile` file in the users home directory.} #' \item{To change an option for all users in an R environment, place the #' options update in the `.Rprofile.site` file in the R home directory.} #' } #' #' #' @keywords internal #' @aliases xportr-package #' #' @importFrom lifecycle deprecated #' @importFrom haven write_xpt read_xpt #' @importFrom rlang abort warn inform with_options local_options .data := sym #' %||% #' @importFrom dplyr left_join bind_cols filter select rename rename_with n #' everything arrange group_by summarize mutate ungroup case_when distinct #' tribble if_else across as_tibble #' @importFrom glue glue glue_collapse #' @importFrom cli cli_alert_info cli_h2 cli_alert_success cli_div cli_text #' cli_alert_danger cli_warn #' @importFrom tidyselect all_of any_of where #' @importFrom utils capture.output str tail packageVersion #' @importFrom stringr str_detect str_extract str_replace str_replace_all #' @importFrom readr parse_number #' @importFrom purrr map_chr map2_chr walk iwalk map map_dbl pluck #' @importFrom graphics stem #' @importFrom magrittr %>% extract2 #' @importFrom checkmate assert assert_character assert_choice assert_data_frame #' assert_integer assert_logical assert_string makeAssertion check_data_frame #' check_r6 test_data_frame test_string vname "_PACKAGE" globalVariables(c( "abbr_parsed", "abbr_stem", "adj_orig", "adj_parsed", "col_pos", "dict_varname", "lower_original_varname", "my_minlength", "num_st_ind", "original_varname", "renamed_n", "renamed_var", "use_bundle", "viable_start", "type.x", "type.y", "variable", "length.x", "lenght.y", "e", "length_df", "length_meta", ".env" )) # The following block is used by usethis to automatically manage # roxygen namespace tags. Modify with care! ## usethis namespace: start ## usethis namespace: end NULL
/scratch/gouwar.j/cran-all/cranData/xportr/R/xportr-package.R
#' Wrapper to apply all core xportr functions and write xpt #' #' @param .df A data frame of CDISC standard. #' @param var_metadata A data frame containing variable level metadata #' @param domain Appropriate CDISC dataset name, e.g. ADAE, DM. Used to subset #' the metadata object. #' @param verbose The action this function takes when an action is taken on the #' dataset or function validation finds an issue. See 'Messaging' section for #' details. Options are 'stop', 'warn', 'message', and 'none' #' @param df_metadata A data frame containing dataset level metadata. #' @param path Path where transport file will be written. File name sans will be #' used as `xpt` name. #' @param strict_checks If TRUE, xpt validation will report errors and not write #' out the dataset. If FALSE, xpt validation will report warnings and continue #' with writing out the dataset. Defaults to FALSE #' #' @return Returns the input dataframe invisibly #' @export #' #' @examplesIf requireNamespace("magrittr") #' data("adsl_xportr", "dataset_spec", "var_spec") #' adsl <- adsl_xportr #' #' library(magrittr) #' test_dir <- tempdir() #' #' pipeline_path <- file.path(test_dir, "adslpipe.xpt") #' xportr_path <- file.path(test_dir, "adslxptr.xpt") #' #' dataset_spec_low <- setNames(dataset_spec, tolower(names(dataset_spec))) #' names(dataset_spec_low)[[2]] <- "label" #' #' var_spec_low <- setNames(var_spec, tolower(names(var_spec))) #' names(var_spec_low)[[5]] <- "type" #' #' adsl %>% #' xportr_metadata(var_spec_low, "ADSL", verbose = "none") %>% #' xportr_type() %>% #' xportr_length() %>% #' xportr_label() %>% #' xportr_order() %>% #' xportr_format() %>% #' xportr_df_label(dataset_spec_low) %>% #' xportr_write(pipeline_path) #' #' # `xportr()` can be used to apply a whole pipeline at once #' xportr( #' adsl, #' var_metadata = var_spec_low, #' df_metadata = dataset_spec_low, #' domain = "ADSL", #' verbose = "none", #' path = xportr_path #' ) xportr <- function(.df, var_metadata = NULL, df_metadata = NULL, domain = NULL, verbose = NULL, path, strict_checks = FALSE) { .df %>% xportr_metadata(var_metadata, domain = domain, verbose = verbose) %>% xportr_type() %>% xportr_length() %>% xportr_label() %>% xportr_order() %>% xportr_format() %>% xportr_df_label(df_metadata) %>% xportr_write(path) }
/scratch/gouwar.j/cran-all/cranData/xportr/R/xportr.R
#' A list with all the supported options of xportr #' #' An internal list with all the supported options of xportr with defaults #' @keywords internal xportr_options_list <- list( xportr.df_domain_name = getOption("xportr.df_domain_name", "dataset"), xportr.df_label = getOption("xportr.df_label", "label"), xportr.domain_name = getOption("xportr.domain_name", "dataset"), xportr.variable_name = getOption("xportr.variable_name", "variable"), xportr.type_name = getOption("xportr.type_name", "type"), xportr.label = getOption("xportr.label", "label"), xportr.length = getOption("xportr.length", "length"), xportr.order_name = getOption("xportr.order_name", "order"), xportr.format_name = getOption("xportr.format_name", "format"), xportr.format_verbose = getOption("xportr.format_verbose", "none"), xportr.label_verbose = getOption("xportr.label_verbose", "none"), xportr.length_verbose = getOption("xportr.length_verbose", "none"), xportr.type_verbose = getOption("xportr.type_verbose", "none"), xportr.character_types = getOption("xportr.character_types", "character"), xportr.character_metadata_types = getOption( "xportr.character_metadata_types", c( "character", "char", "text", "date", "posixct", "posixt", "datetime", "time", "partialdate", "partialtime", "partialdatetime", "incompletedatetime", "durationdatetime", "intervaldatetime" ) ), xportr.numeric_metadata_types = getOption( "xportr.numeric_metadata_types", c("integer", "numeric", "num", "float") ), xportr.numeric_types = getOption( "xportr.numeric_types", c("integer", "float", "numeric", "posixct", "posixt", "time", "date") ) ) .onLoad <- function(libname, pkgname) { op <- options() toset <- !(names(xportr_options_list) %in% names(op)) if (any(toset)) options(xportr_options_list[toset]) invisible() }
/scratch/gouwar.j/cran-all/cranData/xportr/R/zzz.R
--- title: "Standards in Different Regulatory Agencies" output: rmarkdown::html_vignette: toc: true check_title: TRUE vignette: > %\VignetteIndexEntry{Standards in Different Regulatory Agencies} %\VignetteEngine{knitr::rmarkdown} %\VignetteEncoding{UTF-8} --- # Motivation The `xportr` package is designed to help clinical programmers create `CDISC` compliant `xpt` files. It provides the functionality to associate metadata information to a local R data frame, perform data set level validation checks, and convert into a transport v5 file (`xpt`). However, technical requirements related to the `xpt` files can change across different regulatory agencies. This vignette aims to start to provide a clear and concise summary of the differences between the agencies for the `xpt` files. Further updates will come with later package releases. The following section will delve into various technical specifications as per [FDA](https://www.fda.gov/media/153632/download), [NMPA](https://www.nmpa.gov.cn/directory/web/nmpa/images/obbSqc7vwdm0ssrU0enKb7dtd29u9a4tbzUrdTyo6jK1NDQo6mhty5wZGY=.pdf), and [PMDA](https://www.pmda.go.jp/files/000247157.pdf) guidelines. ### File name - character #### XPT <img src="../man/figures/xpt.png" style="height: 34px;"/> The first character must be an English letter (A, B, C, . . ., Z) or underscore (_). Subsequent characters can be letters, numeric digits (0, 1, . . ., 9), or underscores. You can use uppercase or lowercase letters. Blanks cannot appear in SAS names. Special characters, except for the underscore, are not allowed. #### FDA <img src="../man/figures/fda.jpg" style="height: 20px;"/> Dataset in the transport file should be named the same as the transport file. Variable names, as well as variable and dataset labels should include American Standard Code for Information Interchange (ASCII) text codes only. Dataset names should contain only lowercase letters, numbers, and must start with a letter. #### NMPA <img src="../man/figures/nmpa.png" style="height: 27px;"/> The file name and the dataset name must be the same for the SDTM and ADaM datasets. The Japanese dataset and alphanumeric dataset must be identical in structure, except for the data lengths of the Japanese items and the corresponding alphanumeric character sequence #### PMDA <img src="../man/figures/pmda.png" style="height: 20px;"/> Information has not yet been collected. *** ### File name - length #### XPT <img src="../man/figures/xpt.png" style="height: 34px;"/> maximum length of 8 bytes #### FDA <img src="../man/figures/fda.jpg" style="height: 20px;"/> 8 characters #### NMPA <img src="../man/figures/nmpa.png" style="height: 27px;"/> \- #### PMDA <img src="../man/figures/pmda.png" style="height: 20px;"/> Information has not yet been collected. *** ### Variable name #### XPT <img src="../man/figures/xpt.png" style="height: 34px;"/> The name can contain letters of the Latin alphabet, numerals, or underscores. The name cannot contain blanks or special characters except for the underscore. The name must begin with a letter of the Latin alphabet (A–Z, a–z) or the underscore. #### FDA <img src="../man/figures/fda.jpg" style="height: 20px;"/> Variable names, as well as variable and dataset labels should include American Standard Code for Information Interchange (ASCII) text codes only. Variable names should contain only uppercase letters, numbers, and must start with a letter #### NMPA <img src="../man/figures/nmpa.png" style="height: 27px;"/> The Japanese dataset and alphanumeric dataset must be identical in structure, except for the data lengths of the Japanese items and the corresponding alphanumeric character sequence #### PMDA <img src="../man/figures/pmda.png" style="height: 20px;"/> Information has not yet been collected. *** ### Variable length #### XPT <img src="../man/figures/xpt.png" style="height: 34px;"/> 8 bytes #### FDA <img src="../man/figures/fda.jpg" style="height: 20px;"/> 8 characters #### NMPA <img src="../man/figures/nmpa.png" style="height: 27px;"/> \- #### PMDA <img src="../man/figures/pmda.png" style="height: 20px;"/> Information has not yet been collected. *** ### Label character #### XPT <img src="../man/figures/xpt.png" style="height: 34px;"/> \- #### FDA <img src="../man/figures/fda.jpg" style="height: 20px;"/> Variable names, as well as variable and dataset labels should include American Standard Code for Information Interchange (ASCII) text codes only. Do not submit study data with the following special characters in variable and dataset labels: 1. Unbalanced apostrophe, e.g., "Parkinson's" 2. Unbalanced single and double quotation marks 3. Unbalanced parentheses, braces or brackets, e.g.,`(`, `{`and `[` #### NMPA <img src="../man/figures/nmpa.png" style="height: 27px;"/> The Japanese dataset and alphanumeric dataset must be identical in structure, except for the data lengths of the Japanese items and the corresponding alphanumeric character sequence #### PMDA <img src="../man/figures/pmda.png" style="height: 20px;"/> For eSubmission in China, one of the requirements is to translate the foreign language data package (e.g., English) to Chinese. Variable labels, dataset labels, MedDRA, WHO Drug terms, primary endpoint-related code lists, etc., need to be translated from English to Chinese. *** ### Label length #### XPT <img src="../man/figures/xpt.png" style="height: 34px;"/> 40 bytes #### FDA <img src="../man/figures/fda.jpg" style="height: 20px;"/> 40 characters #### NMPA <img src="../man/figures/nmpa.png" style="height: 27px;"/> \- #### PMDA <img src="../man/figures/pmda.png" style="height: 20px;"/> Information has not yet been collected. *** ### Values character #### XPT <img src="../man/figures/xpt.png" style="height: 34px;"/> \- #### FDA <img src="../man/figures/fda.jpg" style="height: 20px;"/> Variable values are the most broadly compatible with software and operating systems when they are restricted to ASCII text codes (printable values below 128). Use UTF-8 for extending character sets; however, the use of extended mappings is not recommended. Transcoding errors, variable length errors, and lack of software support for multi byte UTF-8 encodings can result in incorrect character display and variable value truncation. #### NMPA <img src="../man/figures/nmpa.png" style="height: 27px;"/> If variables had been collected in Japanese and there is a risk of losing certain information by translating it into English, the descriptions in Japanese are necessary and appropriate, and data written in Japanese (hereinafter referred to as Japanese data) may be submitted. In the Japanese dataset, only the Japanese items should be Japanese and the rest should be alphanumeric(=ASCII) data, similar to that in the alphanumeric dataset. #### PMDA <img src="../man/figures/pmda.png" style="height: 20px;"/> For eSubmission in China, one of the requirements is to translate the foreign language data package (e.g., English) to Chinese. Variable labels, dataset labels, MedDRA, WHO Drug terms, primary endpoint-related code lists, etc., need to be translated from English to Chinese. *** ### Values length #### XPT <img src="../man/figures/xpt.png" style="height: 34px;"/> 200 bytes #### FDA <img src="../man/figures/fda.jpg" style="height: 20px;"/> The allotted length for each column containing character (text) data should be set to the maximum length of the variable used across all datasets in the study except for supplementary qualification datasets. #### NMPA <img src="../man/figures/nmpa.png" style="height: 27px;"/> \- #### PMDA <img src="../man/figures/pmda.png" style="height: 20px;"/> Information has not yet been collected. *** ### Format #### XPT <img src="../man/figures/xpt.png" style="height: 34px;"/> SAS format #### FDA <img src="../man/figures/fda.jpg" style="height: 20px;"/> SAS format #### NMPA <img src="../man/figures/nmpa.png" style="height: 27px;"/> \- #### PMDA <img src="../man/figures/pmda.png" style="height: 20px;"/> Information has not yet been collected. *** ### Type #### XPT <img src="../man/figures/xpt.png" style="height: 34px;"/> Numeric and character #### FDA <img src="../man/figures/fda.jpg" style="height: 20px;"/> \- #### NMPA <img src="../man/figures/nmpa.png" style="height: 27px;"/> \- #### PMDA <img src="../man/figures/pmda.png" style="height: 20px;"/> \- *** ### File size #### XPT <img src="../man/figures/xpt.png" style="height: 34px;"/> \- #### FDA <img src="../man/figures/fda.jpg" style="height: 20px;"/> 5 GB #### NMPA <img src="../man/figures/nmpa.png" style="height: 27px;"/> To be consulted if sponsors have datasets >= 5 GB No requirement to split datasets #### PMDA <img src="../man/figures/pmda.png" style="height: 20px;"/> Information has not yet been collected.
/scratch/gouwar.j/cran-all/cranData/xportr/inst/doc/agency_standards.Rmd
## ---- include = FALSE--------------------------------------------------------- knitr::opts_chunk$set( collapse = TRUE, comment = " " ) options(cli.num_colors = 1) library(DT) ## ---- include=FALSE----------------------------------------------------------- # Used to control str() output later on local({ hook_output <- knitr::knit_hooks$get("output") knitr::knit_hooks$set(output = function(x, options) { if (!is.null(options$max.height)) { options$attr.output <- c( options$attr.output, sprintf('style="max-height: %s;"', options$max.height) ) } hook_output(x, options) }) }) ## ---- message = FALSE--------------------------------------------------------- library(xportr) library(dplyr) library(haven) data("adsl_xportr", "var_spec", "dataset_spec", package = "xportr") colnames(var_spec) ADSL <- adsl_xportr ## ---- eval = FALSE------------------------------------------------------------ # xportr_options( # xportr.variable_name = "Variable", # xportr.label = "Label", # xportr.type_name = "Data Type", # xportr.format = "Format", # xportr.length = "Length", # xportr.order_name = "Order" # ) # # # Or alternatively # options( # xportr.variable_name = "Variable", # xportr.label = "Label", # xportr.type_name = "Data Type", # xportr.format = "Format", # xportr.length = "Length", # xportr.order_name = "Order" # ) ## ---- eval = FALSE------------------------------------------------------------ # # Default verbose is set to `none` # xportr_options( # xportr.format_verbose = "none", # xportr.label_verbose = "none", # xportr.length_verbose = "none", # xportr.type_verbose = "none" # ) # # xportr_options( # xportr.format_verbose = "none", # Disables any messaging, keeping the console output clean # xportr.label_verbose = "message", # Sends a standard message to the console # xportr.length_verbose = "warn", # Sends a warning message to the console # xportr.type_verbose = "stop" # Stops execution and sends an error message to the console # ) ## ---- eval = FALSE------------------------------------------------------------ # ADSL %>% # xportr_type(var_spec, "ADSL", "message") %>% # xportr_length(var_spec, "ADSL", verbose = "message") %>% # xportr_label(var_spec, "ADSL", "message") %>% # xportr_order(var_spec, "ADSL", "message") %>% # xportr_format(var_spec, "ADSL") %>% # xportr_df_label(dataset_spec, "ADSL") %>% # xportr_write("adsl.xpt") ## ---- eval = FALSE------------------------------------------------------------ # ADSL %>% # xportr_metadata(var_spec, "ADSL") %>% # xportr_type() %>% # xportr_length(length_source = "metadata") %>% # xportr_label() %>% # xportr_order() %>% # xportr_format() %>% # xportr_df_label(dataset_spec) %>% # xportr_write("adsl.xpt") ## ----------------------------------------------------------------------------- var_spec <- var_spec %>% rename(type = "Data Type") %>% rename_with(tolower) dataset_spec <- dataset_spec %>% rename(label = "Description") %>% rename_with(tolower) ## ---- echo = FALSE------------------------------------------------------------ columns2hide <- c( "significant digits", "mandatory", "assigned value", "codelist", "common", "origin", "pages", "method", "predecessor", "role", "comment", "developer notes" ) datatable( var_spec %>% select(-all_of(columns2hide)), rownames = FALSE, filter = "top", options = list( dom = "Bfrtip", columnDefs = list( list( width = "10px", targets = c("order", "length", "format", "type", "dataset", "variable") ), list( className = "text-left", targets = c("label") ) ), searching = FALSE, autoWidth = TRUE ) ) %>% formatStyle(0, target = "row", color = "black", backgroundColor = "white", fontWeight = "500", lineHeight = "85%", textAlign = "center", fontSize = ".875em" # same as code ) ## ----------------------------------------------------------------------------- adsl_fct <- ADSL %>% mutate(STUDYID = as_factor(STUDYID)) ## ---- echo = FALSE------------------------------------------------------------ adsl_glimpse <- adsl_fct %>% select(STUDYID, TRTSDT, TRTEDT, SCRFDT, EOSDT, FRVDT, RANDDT, DTHDT, LSTALVDT) ## ---- echo = FALSE------------------------------------------------------------ glimpse(adsl_glimpse) ## ---- echo = TRUE------------------------------------------------------------- adsl_type <- xportr_type(.df = adsl_fct, metadata = var_spec, domain = "ADSL", verbose = "warn") ## ---- echo = FALSE------------------------------------------------------------ adsl_type_glimpse <- adsl_type %>% select(STUDYID, TRTSDT, TRTEDT, SCRFDT, EOSDT, FRVDT, RANDDT, DTHDT, LSTALVDT) ## ---- echo = TRUE------------------------------------------------------------- glimpse(adsl_type_glimpse) ## ---- echo = TRUE, error = TRUE----------------------------------------------- adsl_type <- xportr_type(.df = adsl_fct, metadata = var_spec, domain = "ADSL", verbose = "stop") ## ---- max.height='300px', attr.output='.numberLines', echo = FALSE------------ str(ADSL) ## ---- echo = TRUE------------------------------------------------------------- adsl_length <- xportr_length( .df = ADSL, metadata = var_spec, domain = "ADSL", verbose = "warn", length_source = "metadata" ) ## ---- max.height='300px', attr.output='.numberLines', echo = FALSE------------ str(adsl_length) ## ---- echo = TRUE, error = TRUE----------------------------------------------- adsl_length <- xportr_length( .df = ADSL, metadata = var_spec, domain = "ADSL", verbose = "stop", length_source = "metadata" ) ## ---- echo = TRUE------------------------------------------------------------- var_spec_lbl <- var_spec %>% mutate(label = if_else(variable == "TRTSDT", "Length of variable label must be 40 characters or less", label )) adsl_lbl <- ADSL adsl_lbl <- haven::zap_label(ADSL) ## ---- max.height='300px', attr.output='.numberLines', echo = FALSE------------ str(adsl_lbl) ## ----------------------------------------------------------------------------- adsl_lbl <- xportr_label(.df = adsl_lbl, metadata = var_spec_lbl, domain = "ADSL", verbose = "warn") ## ---- max.height='300px', attr.output='.numberLines', echo = FALSE------------ str(adsl_lbl) ## ---- echo = TRUE, error = TRUE----------------------------------------------- adsl_label <- xportr_label(.df = adsl_lbl, metadata = var_spec_lbl, domain = "ADSL", verbose = "stop") ## ----------------------------------------------------------------------------- adsl_ord <- xportr_order(.df = ADSL, metadata = var_spec, domain = "ADSL", verbose = "warn") ## ---- echo = TRUE, error = TRUE----------------------------------------------- adsl_ord <- xportr_order(.df = ADSL, metadata = var_spec, domain = "ADSL", verbose = "stop") ## ---- echo = TRUE------------------------------------------------------------- adsl_fmt <- ADSL %>% xportr_type(metadata = var_spec, domain = "ADSL", verbose = "warn") %>% xportr_format(metadata = var_spec, domain = "ADSL") ## ---- max.height='300px', attr.output='.numberLines', echo = FALSE------------ str(adsl_fmt) ## ---- echo = TRUE, error = TRUE----------------------------------------------- ADSL %>% xportr_metadata(var_spec, "ADSL") %>% xportr_type() %>% xportr_length(length_source = "metadata") %>% xportr_label() %>% xportr_order() %>% xportr_format() %>% xportr_df_label(dataset_spec) %>% xportr_write(path = "adsl.xpt", strict_checks = FALSE) ## ---- echo = TRUE, error = TRUE----------------------------------------------- ADSL %>% xportr_write(path = "adsl.xpt", metadata = dataset_spec, domain = "ADSL", strict_checks = TRUE) ## ---- echo = TRUE, error = TRUE----------------------------------------------- var_spec_lbl <- var_spec %>% mutate(label = if_else(variable == "TRTSDT", "Length of variable label must be 40 characters or less", label )) ADSL %>% xportr_metadata(var_spec_lbl, "ADSL") %>% xportr_label() %>% xportr_type() %>% xportr_format() %>% xportr_df_label(dataset_spec) %>% xportr_write(path = "adsl.xpt", strict_checks = TRUE) ## ---- echo = TRUE, error = TRUE----------------------------------------------- xportr( ADSL, var_metadata = var_spec, df_metadata = dataset_spec, domain = "ADSL", verbose = "none", path = "adsl.xpt" ) ## ---- echo = TRUE, error = TRUE----------------------------------------------- ADSL %>% xportr_metadata(var_spec, "ADSL") %>% xportr_type() %>% xportr_length(length_source = "metadata") %>% xportr_label() %>% xportr_order() %>% xportr_format() %>% xportr_df_label(dataset_spec) %>% xportr_write(path = "adsl.xpt", strict_checks = FALSE)
/scratch/gouwar.j/cran-all/cranData/xportr/inst/doc/deepdive.R
--- title: "Deep Dive into xportr" output: rmarkdown::html_vignette: toc: true check_title: TRUE vignette: > %\VignetteIndexEntry{Deep Dive into xportr} %\VignetteEngine{knitr::rmarkdown} %\VignetteEncoding{UTF-8} --- ```{r, include = FALSE} knitr::opts_chunk$set( collapse = TRUE, comment = " " ) options(cli.num_colors = 1) library(DT) ``` ```{r, include=FALSE} # Used to control str() output later on local({ hook_output <- knitr::knit_hooks$get("output") knitr::knit_hooks$set(output = function(x, options) { if (!is.null(options$max.height)) { options$attr.output <- c( options$attr.output, sprintf('style="max-height: %s;"', options$max.height) ) } hook_output(x, options) }) }) ``` ```{css, echo=FALSE} /* Used to control DT outputs */ .text-left { text-align: left; } ``` # Introduction This vignette will explore in detail all the possibilities of the `{xportr}` package for applying information from a metadata object to an R created dataset using the core `{xportr}` functions. We will also explore the following: * What goes in a Submission to a Health Authority, and what role does `{xportr}` play in that Submission? * What is `{xportr}` validating behind the scenes? * Breakdown of `{xportr}` and a ADaM dataset specification file. * Using `options()` and `xportr_metadata()` to enhance your `{xportr}` experience. * Understanding the warning and error messages for each `{xportr}` function. * A brief discussion on future work. **NOTE:** We use the phrase _metadata object_ throughout this package. A _metadata object_ can either be a specification file read into R as a dataframe or a `{metacore}` object. The _metadata object_ created via the `{metacore}` package has additional features not covered here, but at its core is using a specification file. However, `{xportr}` will work with either a dataframe or a `{metacore}` object. # What goes in a Submission to a Health Authority? Quite a bit! We will focus on the data deliverables and supporting documentation needed for a successful submission to a Health Authority and how `{xportr}` can play a key role. We will briefly look at three parts: 1) Study Data Standardization Plan 2) SDTM Data Package 3) ADaM Data Package ## Study Data Standardization Plan The Study Data Standardization Plan (SDSP) establishes and documents a plan for describing the data standardization approach for clinical and nonclinical studies within a development program. The SDSP also assists the FDA in identifying potential data standardization issues early in the development program. We hope the brevity of this section does not belie the huge importance of this document. Please see [Study Data Standardisation Plan (SDSP) Package](https://advance.phuse.global/display/WEL/Study+Data+Standardisation+Plan+%28SDSP%29+Package) maintained by the [PHUSE working group](https://advance.phuse.global/display/WEL/Welcome+to+the+PHUSE+Advance+Hub). However, we want to focus more on the actual data and how `{xportr}` can play a role in the submission. ## SDTM and ADaM Data Packages __SDTM:__ The primary pieces of the SDTM package are the SDTM annotated case report forms (acrf.pdf), the data definitions document (define.xml), the Study Data Reviewer's Guide (sdrg.pdf) and the datasets in xpt Version 5 format. The Version 5 xpt file is the **required** submission format for all datasets going to the Health Authorities. __ADaM:__ The key components of the ADaM package are very similar to SDTM package with a few additions: define.xml, Analysis Study Data Reviewer's Guide (adrg.pdf), Analysis Results Metadata (analysis-results-metadata.pdf) and datasets as Version 5 xpt format. As both Data Packages need compliant `xpt` files, we feel that `{xportr}` can play a pivotal role here. The core functions in `{xportr}` can be used to apply information from the _metadata object_ to the datasets giving users feedback on the quality of the metadata and data. `xportr_write()` can then be used to write out the final dataset as an `xpt` file, which can be submitted to a Health Authority. ## What is `{xportr}` validating in these Data Packages? The `xpt` Version 5 files form the backbone of any successful Submission and are govern by quite a lot of rules and suggested guidelines. As you are preparing your data packages for submission the suite of core `{xportr}` functions, plus `xportr_write()`, helps to check that your datasets are submission compliant. The package checks many of the latest rules laid out in the [Study Data Technical Conformance Guide](https://www.fda.gov/regulatory-information/search-fda-guidance-documents/study-data-technical-conformance-guide-technical-specifications-document), but please note that it is not yet an exhaustive list of checks. We envision that users are also submitting their `xpts` and metadata to additional validation software. Each of the core `{xportr}` functions for applying labels, types, formats, order and lengths provides feedback to users on submission compliance. However, a final check is implemented when `xportr_write()` is called to create the `xpt`. `xportr_write()` calls [`xpt_validate()`](https://github.com/atorus-research/xportr/blob/231e959b84aa0f1e71113c85332de33a827e650a/R/utils-xportr.R#L174), which is a behind the scenes/non-exported function that does a final check for compliance. At the time of `{xportr} v0.3.0` we are checking the following when a user writes out an `xpt` file.: <img src="../man/figures/xpt_validate.png" alt="validate" style="width: calc(100% - 2px); padding: 0; margin: 0;"/> # {xportr} in action In this section, we are going to explore the 5 core `{xportr}` functions using: * `data("adsl_xportr", package = "xportr")` - An ADSL ADaM dataset from the Pilot 3 Submission to the FDA * `data("var_spec", package = "xportr")` - The ADSL ADaM Specification File from the Pilot 3 Submission to the FDA We will focus on warning and error messaging with contrived examples from these functions by manipulating either the datasets or the specification files. **NOTE:** We have made the ADSL and Spec available in this package. Users can find additional datasets and specification files on our [repo](https://github.com/atorus-research/xportr) in the `example_data_specs` folder. This is to keep the package to a minimum size. ## Using `options()` and `xportr_metadata()` to enhance your experience. Before we dive into the functions, we want to point out some quality of life utilities to make your `xpt` generation life a little bit easier. * `options()` * `xportr_options()` * `xportr_metadata()` **NOTE:** As long as you have a well-defined _metadata object_ you do NOT need to use `options()` or `xportr_metadata()`, but we find these handy to use and think they deserve a quick mention! ## You've got `options()` or `xportr_options()` `{xportr}` is built with certain assumptions around specification column names and information in those columns. We have found that each company specification file can differ slightly from our assumptions. For example, one company might call a column `Variables`, another `Variable` and another `variables`. Rather than trying to regex ourselves out of this situation, we have introduced `options()`. `options()` allows users to control those assumptions inside `{xportr}` functions based on their needs. Additionally, we have a helper function `xportr_options()` which works just like the `options()` but, it can also be used to get the current state of the xportr options. Let's take a look at our example specification file names available in this package. We can see that all the columns start with an upper case letter and have spaces in several of them. We could convert all the column names to lower case and deal with the spacing using some `{dplyr}` functions or base R, or we could just use `options()`! ```{r, message = FALSE} library(xportr) library(dplyr) library(haven) data("adsl_xportr", "var_spec", "dataset_spec", package = "xportr") colnames(var_spec) ADSL <- adsl_xportr ``` By using `options()` or `xportr_options()` at the beginning of our script we can tell `{xportr}` what the valid names are (see chunk below). Please note that before we set the options the package assumed every thing was in lowercase and there were no spaces in the names. After running `options()` or `xportr_options()`, `{xportr}` sees the column `Variable` as the valid name rather than `variable`. You can inspect `xportr_options` function docs to look at additional options. ```{r, eval = FALSE} xportr_options( xportr.variable_name = "Variable", xportr.label = "Label", xportr.type_name = "Data Type", xportr.format = "Format", xportr.length = "Length", xportr.order_name = "Order" ) # Or alternatively options( xportr.variable_name = "Variable", xportr.label = "Label", xportr.type_name = "Data Type", xportr.format = "Format", xportr.length = "Length", xportr.order_name = "Order" ) ``` ## Are we being too verbose? One final note on the options. 4 of the core `{xportr}` functions have the ability to set messaging as `"none", "message", "warn", "stop"`. Setting each of these in all your calls can be a bit repetitive. You can use `options()` or `xportr_options()` to set these at a higher level and avoid this repetition. ```{r, eval = FALSE} # Default verbose is set to `none` xportr_options( xportr.format_verbose = "none", xportr.label_verbose = "none", xportr.length_verbose = "none", xportr.type_verbose = "none" ) xportr_options( xportr.format_verbose = "none", # Disables any messaging, keeping the console output clean xportr.label_verbose = "message", # Sends a standard message to the console xportr.length_verbose = "warn", # Sends a warning message to the console xportr.type_verbose = "stop" # Stops execution and sends an error message to the console ) ``` ## Going meta Each of the core `{xportr}` functions requires several inputs: A valid dataframe, a metadata object and a domain name, along with optional messaging. For example, here is a simple call using all of the functions. As you can see, a lot of information is repeated in each call. ```{r, eval = FALSE} ADSL %>% xportr_type(var_spec, "ADSL", "message") %>% xportr_length(var_spec, "ADSL", verbose = "message") %>% xportr_label(var_spec, "ADSL", "message") %>% xportr_order(var_spec, "ADSL", "message") %>% xportr_format(var_spec, "ADSL") %>% xportr_df_label(dataset_spec, "ADSL") %>% xportr_write("adsl.xpt") ``` To help reduce these repetitive calls, we have created `xportr_metadata()`. A user can just **set** the _metadata object_ and the Domain name in the first call, and this will be passed on to the other functions. Much cleaner! ```{r, eval = FALSE} ADSL %>% xportr_metadata(var_spec, "ADSL") %>% xportr_type() %>% xportr_length(length_source = "metadata") %>% xportr_label() %>% xportr_order() %>% xportr_format() %>% xportr_df_label(dataset_spec) %>% xportr_write("adsl.xpt") ``` ## Warnings and Errors For the next six sections, we are going to explore the Warnings and Errors messages generated by the `{xportr}` core functions. To better explore these, we will either manipulate the ADaM dataset or specification file to help showcase the ability of the `{xportr}` functions to detect issues. **NOTE:** We have made the ADSL, `xportr::adsl`, and Specification File, `xportr::var_spec`, available in this package. Users can find additional datasets and specification files on our [repo](https://github.com/atorus-research/xportr) in the `example_data_specs` folder. ### Setting up our metadata object First, let's read in the specification file and call it `var_spec`. Note that we are not using `options()` here. We will do some slight manipulation to the column names by doing all lower case, and changing `Data Type` to `type` and making the Order column numeric. You can also use `options()` for this step as well. The `var_spec` object has five dataset specification files stacked on top of each other. We will make use of the `ADSL` subset of `var_spec`. You can make use of the Search field above the dataset column to subset the specification file for `ADSL` Similarly, we can read the Dataset spec file and call it `dataset_spec`. ```{r} var_spec <- var_spec %>% rename(type = "Data Type") %>% rename_with(tolower) dataset_spec <- dataset_spec %>% rename(label = "Description") %>% rename_with(tolower) ``` ```{r, echo = FALSE} columns2hide <- c( "significant digits", "mandatory", "assigned value", "codelist", "common", "origin", "pages", "method", "predecessor", "role", "comment", "developer notes" ) datatable( var_spec %>% select(-all_of(columns2hide)), rownames = FALSE, filter = "top", options = list( dom = "Bfrtip", columnDefs = list( list( width = "10px", targets = c("order", "length", "format", "type", "dataset", "variable") ), list( className = "text-left", targets = c("label") ) ), searching = FALSE, autoWidth = TRUE ) ) %>% formatStyle(0, target = "row", color = "black", backgroundColor = "white", fontWeight = "500", lineHeight = "85%", textAlign = "center", fontSize = ".875em" # same as code ) ``` ## `xportr_type()` We are going to explore the type column in the metadata object. A submission to a Health Authority should only have character and numeric types in the data. In the `ADSL` data we have several columns that are in the Date type: `TRTSDT`, `TRTEDT`, `SCRFDT`, `EOSDT`, `FRVDT`, `RANDDT`, `DTHDT`, `LSTALVDT` - under the hood these are actually numeric values and will be left as is. We will change one variable type to a [factor variable](https://forcats.tidyverse.org/), which is a common data structure in R, to give us some educational opportunities to see `xportr_type()` in action. ```{r} adsl_fct <- ADSL %>% mutate(STUDYID = as_factor(STUDYID)) ``` ```{r, echo = FALSE} adsl_glimpse <- adsl_fct %>% select(STUDYID, TRTSDT, TRTEDT, SCRFDT, EOSDT, FRVDT, RANDDT, DTHDT, LSTALVDT) ``` ```{r, echo = FALSE} glimpse(adsl_glimpse) ``` ```{r, echo = TRUE} adsl_type <- xportr_type(.df = adsl_fct, metadata = var_spec, domain = "ADSL", verbose = "warn") ``` ```{r, echo = FALSE} adsl_type_glimpse <- adsl_type %>% select(STUDYID, TRTSDT, TRTEDT, SCRFDT, EOSDT, FRVDT, RANDDT, DTHDT, LSTALVDT) ``` Success! As we can see below, `xportr_type()` applied the types from the metadata object to the `STUDYID` variables converting to the proper type. The functions in `{xportr}` also display this coercion to the user in the console, which is seen above. ```{r, echo = TRUE} glimpse(adsl_type_glimpse) ``` Note that `xportr_type(verbose = "warn")` was set so the function has provided feedback, which would show up in the console, on which variables were converted as a warning message. However, you can set `verbose = "stop"` so that the types are not applied if the data does not match what is in the specification file. Using `verbose = "stop"` will instantly stop the processing of this function and not create the object. A user will need to alter the variables in their R script before using `xportr_type()` ```{r, echo = TRUE, error = TRUE} adsl_type <- xportr_type(.df = adsl_fct, metadata = var_spec, domain = "ADSL", verbose = "stop") ``` ## `xportr_length()` There are two sources of length (data-driven and spec-driven): - Data-driven length: max length for character columns and 8 for other data types - Spec-driven length: from the metadata 1. Users can either specify the length in the metadata or leave it blank for data-driven length. 2. When the length is missing in the metadata, the data-driven length will be applied. Next we will use `xportr_length()` to apply the length column of the _metadata object_ to the `ADSL` dataset. Using the `str()` function we have displayed all the variables with their attributes. You can see that each variable has a label, but there is no information on the lengths of the variable. ```{r, max.height='300px', attr.output='.numberLines', echo = FALSE} str(ADSL) ``` ```{r, echo = TRUE} adsl_length <- xportr_length( .df = ADSL, metadata = var_spec, domain = "ADSL", verbose = "warn", length_source = "metadata" ) ``` Using `xportr_length()` with `verbose = "warn"` we can apply the length column to all the columns in the dataset. The function detects that two variables, `TRTDUR` and `DCREASCD` are missing from the metadata file. Note that the variables have slight misspellings in the dataset and metadata, which is a great catch! However, lengths are still applied with TRTDUR being give a length of 8 and DCREASCD a length of 200. Using the `str()` function, you can see below that `xportr_length()` successfully applied all the lengths of the variable to the variables in the dataset. ```{r, max.height='300px', attr.output='.numberLines', echo = FALSE} str(adsl_length) ``` Just like we did for `xportr_type()`, setting `verbose = "stop"` immediately stops R from processing the lengths. Here the function detects the missing variables and will not apply any lengths to the dataset until corrective action is applied. ```{r, echo = TRUE, error = TRUE} adsl_length <- xportr_length( .df = ADSL, metadata = var_spec, domain = "ADSL", verbose = "stop", length_source = "metadata" ) ``` ## `xportr_label()` As you are creating your dataset in R you will often find that R removes the label of your variable. Using `xportr_label()` you can easily re-apply all your labels to your variables in one quick action. For this example, we are going to manipulate both the metadata and the `ADSL` dataset: * The metadata will have the variable `TRTSDT` label be greater than 40 characters. * The `ADSL` dataset will have all its labels stripped from it. Remember in the length example, the labels were on the original dataset as seen in the `str()` output. ```{r, echo = TRUE} var_spec_lbl <- var_spec %>% mutate(label = if_else(variable == "TRTSDT", "Length of variable label must be 40 characters or less", label )) adsl_lbl <- ADSL adsl_lbl <- haven::zap_label(ADSL) ``` We have successfully removed all the labels. ```{r, max.height='300px', attr.output='.numberLines', echo = FALSE} str(adsl_lbl) ``` Using `xportr_label()` we will apply all the labels from our metadata to the dataset. Please note again that we are using `verbose = "warn"` and the same two issues for `TRTDUR` and `DCREASCD` are reported as missing from the metadata file. An additional message is sent around the `TRTSDT` label having a length of greater than 40. ```{r} adsl_lbl <- xportr_label(.df = adsl_lbl, metadata = var_spec_lbl, domain = "ADSL", verbose = "warn") ``` Success! All labels have been applied that are present in the both the metadata and the dataset. However, please note that the `TRTSDT` variable has had the label with characters greater than 40 **applied** to the dataset and the `TRTDUR` and `DCREASCD` have empty variable labels. ```{r, max.height='300px', attr.output='.numberLines', echo = FALSE} str(adsl_lbl) ``` Just like we did for the other functions, setting `verbose = "stop"` immediately stops R from processing the labels. Here the function detects the mismatches between the variables and labels as well as the label that is greater than 40 characters. As this stops the process, none of the labels will be applied to the dataset until corrective action is applied. ```{r, echo = TRUE, error = TRUE} adsl_label <- xportr_label(.df = adsl_lbl, metadata = var_spec_lbl, domain = "ADSL", verbose = "stop") ``` ## `xportr_order()` The order of the dataset can greatly increase readability of the dataset for downstream stakeholders. For example, having all the treatment related variables or analysis variables grouped together can help with inspection and understanding of the dataset. `xportr_order()` can take the order information from the metadata and apply it to your dataset. ```{r} adsl_ord <- xportr_order(.df = ADSL, metadata = var_spec, domain = "ADSL", verbose = "warn") ``` Readers are encouraged to inspect the dataset and metadata to see the past order and updated order after calling the function. Note the messaging from `xportr_order()`: * Variables not in the metadata are moved to the end * Variables not in order are re-ordered and a message is printed out on which ones were re-ordered. ```{r, echo = TRUE, error = TRUE} adsl_ord <- xportr_order(.df = ADSL, metadata = var_spec, domain = "ADSL", verbose = "stop") ``` Just like we did for the other functions, setting `verbose = "stop"` immediately stops R from processing the order. If variables or metadata are missing from either, the re-ordering will not process until corrective action is performed. ## `xportr_format()` Formats play an important role in the SAS language and have a column in specification files. Being able to easily apply formats into your `xpt` file will allow downstream users of SAS to quickly format the data appropriately when reading into a SAS-based system. `xportr_format()` can take these formats and apply them. Please reference `xportr_length()` or `xportr_label()` to note the missing `attr()` for formats in our `ADSL` dataset. This example is slightly different from previous examples. You will need to use `xportr_type()` to coerce R Date variables and others types to character or numeric. Only then can you use `xportr_format()` to apply the format column to the dataset. ```{r, echo = TRUE} adsl_fmt <- ADSL %>% xportr_type(metadata = var_spec, domain = "ADSL", verbose = "warn") %>% xportr_format(metadata = var_spec, domain = "ADSL") ``` Success! We have taken the metadata formats and applied them to the dataset. Please inspect variables like `TRTSDT` or `DISONSDT` to see the `DATE9.` format being applied. ```{r, max.height='300px', attr.output='.numberLines', echo = FALSE} str(adsl_fmt) ``` At the time of `{xportr} v0.3.0` we have not implemented any warnings or error messaging for this function. However, `xportr_write()` through `xpt_validate()` will check that formats applied are valid SAS formats. ## `xportr_write()` Finally, we want to write out an `xpt` dataset with all our metadata applied. We will make use of `xportr_metadata()` to reduce repetitive metadata and domain specifications. We will use default option for verbose, which is just `message` and so not set anything for `verbose`. In `xportr_write()` we will specify the path, which will just be our current working directory, set the dataset label and toggle the `strict_checks` to be `FALSE`. It is also note worthy that you can set the dataset label using the `xportr_df_label` and a `dataset_spec` which will be used by the `xportr_write()` ```{r, echo = TRUE, error = TRUE} ADSL %>% xportr_metadata(var_spec, "ADSL") %>% xportr_type() %>% xportr_length(length_source = "metadata") %>% xportr_label() %>% xportr_order() %>% xportr_format() %>% xportr_df_label(dataset_spec) %>% xportr_write(path = "adsl.xpt", strict_checks = FALSE) ``` Success! We have applied types, lengths, labels, ordering and formats to our dataset. Note the messages written out to the console. Remember the `TRTDUR` and `DCREASCD` and how these are not present in the metadata, but in the dataset. This impacts the messaging for lengths and labels where `{xportr}` is printing out some feedback to us on the two issues. 5 types are coerced, as well as 36 variables re-ordered. Note that `strict_checks` was set to `FALSE`. The next two examples showcase the `strict_checks = TRUE` option in `xportr_write()` where we will look at formats and labels. ```{r, echo = TRUE, error = TRUE} ADSL %>% xportr_write(path = "adsl.xpt", metadata = dataset_spec, domain = "ADSL", strict_checks = TRUE) ``` As there at several `---DT` type variables, `xportr_write()` detects the lack of formats being applied. To correct this remember you can use `xportr_type()` and `xportr_format()` to apply formats to your xpt dataset. Below we have manipulated the labels to again be greater than 40 characters for `TRTSDT`. We have turned off `xportr_label()` verbose options to only produce a message. However, `xportr_write()` with `strict_checks = TRUE` will error out as this is one of the many `xpt_validate()` checks going on behind the scenes. ```{r, echo = TRUE, error = TRUE} var_spec_lbl <- var_spec %>% mutate(label = if_else(variable == "TRTSDT", "Length of variable label must be 40 characters or less", label )) ADSL %>% xportr_metadata(var_spec_lbl, "ADSL") %>% xportr_label() %>% xportr_type() %>% xportr_format() %>% xportr_df_label(dataset_spec) %>% xportr_write(path = "adsl.xpt", strict_checks = TRUE) ``` ## `xportr()` Too many functions to call? Simplify with `xportr()`. It bundles all core `xportr` functions for writing to `xpt`. ```{r, echo = TRUE, error = TRUE} xportr( ADSL, var_metadata = var_spec, df_metadata = dataset_spec, domain = "ADSL", verbose = "none", path = "adsl.xpt" ) ``` `xportr()` is equivalent to calling the following functions individually: ```{r, echo = TRUE, error = TRUE} ADSL %>% xportr_metadata(var_spec, "ADSL") %>% xportr_type() %>% xportr_length(length_source = "metadata") %>% xportr_label() %>% xportr_order() %>% xportr_format() %>% xportr_df_label(dataset_spec) %>% xportr_write(path = "adsl.xpt", strict_checks = FALSE) ``` ## Future Work `{xportr}` is still undergoing development. We hope to produce more vignettes and functions that will allow users to bulk process multiple datasets as well as have examples of piping `xpt` files and related documentation to a validation software service. As always, please let us know of any feature requests, documentation updates or bugs on [our GitHub repo](https://github.com/Atorus-Research/xportr/issues).
/scratch/gouwar.j/cran-all/cranData/xportr/inst/doc/deepdive.Rmd
## ---- include = FALSE--------------------------------------------------------- knitr::opts_chunk$set( collapse = TRUE, comment = " " ) library(DT) options(cli.num_colors = 1) ## ---- include=FALSE--------------------------------------- options(width = 60) local({ hook_output <- knitr::knit_hooks$get("output") knitr::knit_hooks$set(output = function(x, options) { if (!is.null(options$max.height)) { options$attr.output <- c( options$attr.output, sprintf('style="max-height: %s;"', options$max.height) ) } hook_output(x, options) }) }) ## ---- include=FALSE--------------------------------------- knitr::knit_hooks$set(output = function(x, options) { if (!is.null(options$max_height)) { paste('<pre style = "max-height:', options$max_height, '; float: left; width: 775px; overflow-y: auto;">', x, "</pre>", sep = "" ) } else { x } }) ## ---- include=FALSE--------------------------------------- datatable_template <- function(input_data) { datatable( input_data, rownames = FALSE, options = list( autoWidth = FALSE, scrollX = TRUE, pageLength = 5, lengthMenu = c(5, 10, 15, 20) ) ) %>% formatStyle( 0, target = "row", color = "black", backgroundColor = "white", fontWeight = "500", lineHeight = "85%", fontSize = ".875em" # same as code ) } ## ---- eval = TRUE, message = FALSE, warning = FALSE------- # Loading packages library(dplyr) library(labelled) library(xportr) library(readxl) # Loading in our example data data("adsl_xportr", package = "xportr") ## ---- echo = FALSE---------------------------------------- datatable_template(adsl_xportr) ## --------------------------------------------------------- var_spec <- read_xlsx( system.file(file.path("specs/", "ADaM_spec.xlsx"), package = "xportr"), sheet = "Variables" ) %>% rename(type = "Data Type") %>% rename_with(tolower) ## ---- echo = FALSE, eval = TRUE--------------------------- var_spec_view <- var_spec %>% filter(dataset == "ADSL") datatable_template(var_spec_view) ## ---- max_height = "200px", echo = FALSE----------------- str(adsl_xportr) ## ---- echo = TRUE----------------------------------------- adsl_type <- xportr_type(adsl_xportr, var_spec, domain = "ADSL", verbose = "message") ## ---- max_height = "200px", echo = FALSE----------------- str(adsl_type) ## ---- max_height = "200px", echo = FALSE----------------- str(adsl_xportr) ## --------------------------------------------------------- adsl_length <- adsl_xportr %>% xportr_length(var_spec, domain = "ADSL", verbose = "message") ## ---- max_height = "200px", echo = FALSE----------------- str(adsl_length) ## ---- echo = TRUE----------------------------------------- adsl_order <- xportr_order(adsl_xportr, var_spec, domain = "ADSL", verbose = "message") ## ---- echo = FALSE---------------------------------------- datatable_template(adsl_order) ## ---- max_height = "200px", echo = FALSE------------------ adsl_fmt_pre <- adsl_xportr %>% select(TRTSDT, TRTEDT, TRTSDTM, TRTEDTM) tribble( ~Variable, ~Format, "TRTSDT", attr(adsl_fmt_pre$TRTSDT, which = "format"), "TRTEDT", attr(adsl_fmt_pre$TRTEDT, which = "format"), "TRTSDTM", attr(adsl_fmt_pre$TRTSDTM, which = "format"), "TRTEDTM", attr(adsl_fmt_pre$TRTEDTM, which = "format") ) ## --------------------------------------------------------- adsl_fmt <- adsl_xportr %>% xportr_format(var_spec, domain = "ADSL") ## ---- max_height = "200px", echo = FALSE------------------ adsl_fmt_post <- adsl_fmt %>% select(TRTSDT, TRTEDT, TRTSDTM, TRTEDTM) tribble( ~Variable, ~Format, "TRTSDT", attr(adsl_fmt_post$TRTSDT, which = "format"), "TRTEDT", attr(adsl_fmt_post$TRTEDT, which = "format"), "TRTSDTM", attr(adsl_fmt_post$TRTSDTM, which = "format"), "TRTEDTM", attr(adsl_fmt_post$TRTEDTM, which = "format") ) ## ---- max_height = "200px", echo = FALSE----------------- adsl_no_lbls <- haven::zap_label(adsl_xportr) str(adsl_no_lbls) ## --------------------------------------------------------- adsl_lbl <- adsl_xportr %>% xportr_label(var_spec, domain = "ADSL", "message") ## ---- max_height = "200px"------------------------------- str(adsl_lbl) ## --------------------------------------------------------- adsl_xportr %>% xportr_type(var_spec, "ADSL", "message") %>% xportr_length(var_spec, "ADSL", verbose = "message") %>% xportr_label(var_spec, "ADSL", "message") %>% xportr_order(var_spec, "ADSL", "message") %>% xportr_format(var_spec, "ADSL") %>% xportr_write("adsl.xpt")
/scratch/gouwar.j/cran-all/cranData/xportr/inst/doc/xportr.R
--- title: "Getting Started" output: rmarkdown::html_vignette: toc: true check_title: TRUE vignette: > %\VignetteIndexEntry{Getting Started} %\VignetteEngine{knitr::rmarkdown} %\VignetteEncoding{UTF-8} --- ```{r, include = FALSE} knitr::opts_chunk$set( collapse = TRUE, comment = " " ) library(DT) options(cli.num_colors = 1) ``` ```{r, include=FALSE} options(width = 60) local({ hook_output <- knitr::knit_hooks$get("output") knitr::knit_hooks$set(output = function(x, options) { if (!is.null(options$max.height)) { options$attr.output <- c( options$attr.output, sprintf('style="max-height: %s;"', options$max.height) ) } hook_output(x, options) }) }) ``` ```{r, include=FALSE} knitr::knit_hooks$set(output = function(x, options) { if (!is.null(options$max_height)) { paste('<pre style = "max-height:', options$max_height, '; float: left; width: 775px; overflow-y: auto;">', x, "</pre>", sep = "" ) } else { x } }) ``` ```{r, include=FALSE} datatable_template <- function(input_data) { datatable( input_data, rownames = FALSE, options = list( autoWidth = FALSE, scrollX = TRUE, pageLength = 5, lengthMenu = c(5, 10, 15, 20) ) ) %>% formatStyle( 0, target = "row", color = "black", backgroundColor = "white", fontWeight = "500", lineHeight = "85%", fontSize = ".875em" # same as code ) } ``` # Getting Started with xportr The demo will make use of a small `ADSL` dataset available with the `xportr` package and has the following features: * 306 observations * 51 variables * Data types other than character and numeric * Missing labels on variables * Missing label for data set * Order of variables not following specification file * Formats missing To create a fully compliant v5 xpt `ADSL` dataset, that was developed using R, we will need to apply the 6 main functions within the `xportr` package: * `xportr_type()` * `xportr_length()` * `xportr_order()` * `xportr_format()` * `xportr_label()` * `xportr_write()` ```{r, eval = TRUE, message = FALSE, warning = FALSE} # Loading packages library(dplyr) library(labelled) library(xportr) library(readxl) # Loading in our example data data("adsl_xportr", package = "xportr") ``` ```{r, echo = FALSE} datatable_template(adsl_xportr) ``` # Preparing your Specification Files In order to make use of the functions within `{xportr}` you will need to create an R data frame that contains your specification file. You will most likely need to do some pre-processing of your spec sheets after loading in the spec files for them to work appropriately with the `xportr` functions. Please see our example spec sheets in `system.file(file.path("specs", "ADaM_spec.xlsx"), package = "xportr")` to see how `xportr` expects the specification sheets. ```{r} var_spec <- read_xlsx( system.file(file.path("specs/", "ADaM_spec.xlsx"), package = "xportr"), sheet = "Variables" ) %>% rename(type = "Data Type") %>% rename_with(tolower) ``` Below is a quick snapshot of the specification file pertaining to the `ADSL` data set, which we will make use of in the 6 `{xportr}` function calls below. Take note of the order, label, type, length and format columns. ```{r, echo = FALSE, eval = TRUE} var_spec_view <- var_spec %>% filter(dataset == "ADSL") datatable_template(var_spec_view) ``` # xportr_type() **NOTE:** We make use of `str()` to expose the attributes (length, labels, formats, type) of the datasets. We have suppressed these calls for the sake of brevity. In order to be compliant with transport v5 specifications an `xpt` file can only have two data types: character and numeric/dbl. Currently the `ADSL` data set has chr, dbl, time, factor and date. ```{r, max_height = "200px", echo = FALSE} str(adsl_xportr) ``` Using `xportr_type()` and the supplied specification file, we can *coerce* the variables in the `ADSL` set to be either numeric or character. ```{r, echo = TRUE} adsl_type <- xportr_type(adsl_xportr, var_spec, domain = "ADSL", verbose = "message") ``` Now all appropriate types have been applied to the dataset as seen below. ```{r, max_height = "200px", echo = FALSE} str(adsl_type) ``` # xportr_length() Next we can apply the lengths from a variable level specification file to the data frame. `xportr_length()` will identify variables that are missing from your specification file. The function will also alert you to how many lengths have been applied successfully. Before we apply the lengths lets verify that no lengths have been applied to the original dataframe. ```{r, max_height = "200px", echo = FALSE} str(adsl_xportr) ``` No lengths have been applied to the variables as seen in the printout - the lengths would be in the `attr()` part of each variables. Let's now use `xportr_length()` to apply our lengths from the specification file. ```{r} adsl_length <- adsl_xportr %>% xportr_length(var_spec, domain = "ADSL", verbose = "message") ``` ```{r, max_height = "200px", echo = FALSE} str(adsl_length) ``` Note the additional `attr(*, "width")=` after each variable with the width. These have been directly applied from the specification file that we loaded above! # xportr_order() Please note that the order of the `ADSL` variables, see above, does not match the specification file `order` column. We can quickly remedy this with a call to `xportr_order()`. Note that the variable `SITEID` has been moved as well as many others to match the specification file order column. Variables not in the spec are moved to the end of the data and a message is written to the console. ```{r, echo = TRUE} adsl_order <- xportr_order(adsl_xportr, var_spec, domain = "ADSL", verbose = "message") ``` ```{r, echo = FALSE} datatable_template(adsl_order) ``` # xportr_format() Now we apply formats to the dataset. These will typically be `DATE9.`, `DATETIME20` or `TIME5`, but many others can be used. Notice that in the `ADSL` dataset there are 8 Date/Time variables and they are missing formats. Here we just take a peak at a few `TRT` variables, which have a `NULL` format. ```{r, max_height = "200px", echo = FALSE} adsl_fmt_pre <- adsl_xportr %>% select(TRTSDT, TRTEDT, TRTSDTM, TRTEDTM) tribble( ~Variable, ~Format, "TRTSDT", attr(adsl_fmt_pre$TRTSDT, which = "format"), "TRTEDT", attr(adsl_fmt_pre$TRTEDT, which = "format"), "TRTSDTM", attr(adsl_fmt_pre$TRTSDTM, which = "format"), "TRTEDTM", attr(adsl_fmt_pre$TRTEDTM, which = "format") ) ``` Using our `xportr_format()` we can apply our formats to the dataset. ```{r} adsl_fmt <- adsl_xportr %>% xportr_format(var_spec, domain = "ADSL") ``` ```{r, max_height = "200px", echo = FALSE} adsl_fmt_post <- adsl_fmt %>% select(TRTSDT, TRTEDT, TRTSDTM, TRTEDTM) tribble( ~Variable, ~Format, "TRTSDT", attr(adsl_fmt_post$TRTSDT, which = "format"), "TRTEDT", attr(adsl_fmt_post$TRTEDT, which = "format"), "TRTSDTM", attr(adsl_fmt_post$TRTSDTM, which = "format"), "TRTEDTM", attr(adsl_fmt_post$TRTEDTM, which = "format") ) ``` **NOTE:** You can use `attr(data$variable, which = "format")` to inspect formats applied to a dataframe. The above output has these individual calls bound together for easier viewing. # xportr_label() Please observe that our `ADSL` dataset is missing many variable labels. Sometimes these labels can be lost while using R's function. However, a CDISC compliant data set needs to have each variable with a label. ```{r, max_height = "200px", echo = FALSE} adsl_no_lbls <- haven::zap_label(adsl_xportr) str(adsl_no_lbls) ``` Using the `xport_label` function we can take the specifications file and label all the variables available. `xportr_label` will produce a warning message if you the variable in the data set is not in the specification file. ```{r} adsl_lbl <- adsl_xportr %>% xportr_label(var_spec, domain = "ADSL", "message") ``` ```{r, max_height = "200px"} str(adsl_lbl) ``` # xportr_write() Finally, we arrive at exporting the R data frame object as a `xpt` file with `xportr_write()`. The `xpt` file will be written directly to your current working directory. To make it more interesting, we have put together all six functions with the magrittr pipe, `%>%`. A user can now apply types, length, variable labels, formats, data set label and write out their final xpt file in one pipe! Appropriate warnings and messages will be supplied to a user to the console for any potential issues before sending off to standard clinical data set validator application or data reviewers. ```{r} adsl_xportr %>% xportr_type(var_spec, "ADSL", "message") %>% xportr_length(var_spec, "ADSL", verbose = "message") %>% xportr_label(var_spec, "ADSL", "message") %>% xportr_order(var_spec, "ADSL", "message") %>% xportr_format(var_spec, "ADSL") %>% xportr_write("adsl.xpt") ``` That's it! We now have a `xpt` file created in R with all appropriate types, lengths, labels, ordering and formats from our specification file. If you are interested in exploring more of the custom warnings and error messages as well as more background on `xpt` generation be sure to check out the [Deep Dive](deepdive.html) User Guide. As always, we welcome your feedback. If you spot a bug, would like to see a new feature, or if any documentation is unclear - submit an issue on [xportr's GitHub page](https://github.com/atorus-research/xportr/issues).
/scratch/gouwar.j/cran-all/cranData/xportr/inst/doc/xportr.Rmd