From e298506de032a8957eab814bc5cff91fe040fcc5 Mon Sep 17 00:00:00 2001 From: Michael Kuehn Date: Tue, 5 Jun 2018 08:33:56 -0400 Subject: [PATCH] Add ability to upload Rdata data frame object --- R/ggplot_shiny.R | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/R/ggplot_shiny.R b/R/ggplot_shiny.R index 7dafcb1..74fa313 100644 --- a/R/ggplot_shiny.R +++ b/R/ggplot_shiny.R @@ -28,7 +28,7 @@ ggplot_shiny <- function( dataset = NA ) { "data_input", "", choices = if (is.data.frame(dataset)) { list("Load sample data" = 1, - "Upload text file" = 2, + "Upload file" = 2, "Paste data" = 3, "Data passed through R environment" = 4) } else { @@ -50,7 +50,8 @@ ggplot_shiny <- function( dataset = NA ) { "Excel" = "Excel", "SPSS" = "SPSS", "Stata" = "Stata", - "SAS" = "SAS"), + "SAS" = "SAS", + "Rdata" = "Rdata"), selected = "text"), conditionalPanel( condition = "input.file_type=='text'", @@ -500,6 +501,8 @@ p( data <- read_dta(file_in$datapath) } else if (input$file_type == "SAS") { data <- read_sas(file_in$datapath) + } else if (input$file_type == "Rdata") { + data <- get(load(input$upload$datapath, envir = .GlobalEnv)) } }) }