igroffman commited on
Commit
696fb38
Β·
verified Β·
1 Parent(s): 436bf34

Update app.R

Browse files
Files changed (1) hide show
  1. app.R +38 -29
app.R CHANGED
@@ -498,37 +498,46 @@ server <- function(input, output, session) {
498
  })
499
 
500
  # Processing summary
501
- output$process_summary <- renderText({
502
- if (is.null(input$file)) {
503
- return("No file uploaded yet.")
504
- }
505
-
506
- if (is.null(processed_data())) {
507
- return("Processing...")
 
 
 
 
 
 
 
 
 
 
 
 
 
508
  }
509
-
510
- df <- processed_data()
511
- original_df <- read.csv(input$file$datapath, nrows = 1)
512
- selected_cols_to_remove <- input$columns_to_remove %||% character(0)
513
- removed_cols <- intersect(selected_cols_to_remove, names(original_df))
514
-
515
- summary_text <- paste(
516
- "βœ“ File processed successfully!",
517
- paste("βœ“ Original columns:", ncol(original_df)),
518
- paste("βœ“ Final columns:", ncol(df)),
519
- paste("βœ“ Target columns: 167"),
520
- paste("βœ“ Rows processed:", nrow(df)),
521
- paste("βœ“ Removed columns:", length(removed_cols)),
522
- if (length(removed_cols) > 0) paste(" -", paste(head(removed_cols, 5), collapse = ", "),
523
- if (length(removed_cols) > 5) "..." else ""),
524
- "βœ“ Duplicates removed",
525
- paste("βœ“ Ready for further processing"),
526
- sep = "\n"
527
- )
528
-
529
- return(summary_text)
530
- })
531
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
532
  # Preview table
533
  output$preview <- DT::renderDataTable({
534
  req(processed_data())
 
498
  })
499
 
500
  # Processing summary
501
+ output$process_summary <- renderText({
502
+ if (is.null(input$file)) {
503
+ return("No file uploaded yet.")
504
+ }
505
+
506
+ if (is.null(processed_data())) {
507
+ return("Processing...")
508
+ }
509
+
510
+ df <- processed_data()
511
+ original_df <- read.csv(input$file$datapath, nrows = 1)
512
+ selected_cols_to_remove <- input$columns_to_remove %||% character(0)
513
+ removed_cols <- intersect(selected_cols_to_remove, names(original_df))
514
+
515
+ # Build the removed columns text
516
+ removed_cols_text <- if (length(removed_cols) > 0) {
517
+ cols_display <- if (length(removed_cols) > 5) {
518
+ paste(paste(head(removed_cols, 5), collapse = ", "), "...")
519
+ } else {
520
+ paste(removed_cols, collapse = ", ")
521
  }
522
+ paste("βœ“ Removed columns:", length(removed_cols), "\n -", cols_display)
523
+ } else {
524
+ "βœ“ Removed columns: 0"
525
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
526
 
527
+ summary_text <- paste(
528
+ "βœ“ File processed successfully!",
529
+ paste("βœ“ Original columns:", ncol(original_df)),
530
+ paste("βœ“ Final columns:", ncol(df)),
531
+ paste("βœ“ Target columns: 167"),
532
+ paste("βœ“ Rows processed:", nrow(df)),
533
+ removed_cols_text,
534
+ "βœ“ Duplicates removed",
535
+ paste("βœ“ Ready for further processing"),
536
+ sep = "\n"
537
+ )
538
+
539
+ return(summary_text)
540
+ })
541
  # Preview table
542
  output$preview <- DT::renderDataTable({
543
  req(processed_data())