dreamRs / esquisse

RStudio add-in to make plots interactively with ggplot2
https://dreamrs.github.io/esquisse
Other
1.77k stars 229 forks source link

Coerce option not available while importing data #118

Closed sarthi2395 closed 4 years ago

sarthi2395 commented 4 years ago

I created a shiny app and invoked the esquisse module in the app with import data selected as TRUE. However, I notice that when I run the app locally from rstudio, I get an additional option to coerce the data whereas when I run it from a shiny server, the coerce dropdown does not appear. I am guessing this is due to a missing package but I cannot find anything on this in the docs.

My code

library(shiny)
library(esquisse)
options(shiny.maxRequestSize = 30*1024^2)

ui <- fluidPage(
  esquisserUI(
    id = "esquisse", 
    header = FALSE,
    choose_data = TRUE,
    container = esquisseContainer(fixed = TRUE)
  )
)

server <- function(input, output, session) {

  data_r <- reactiveValues(data = data.frame(), name = "default")

  callModule(module = esquisserServer, id = "esquisse", data = NULL, dataModule = "ImportFile", sizeDataModule="l")

}

shinyApp(ui, server)
xiangnandang commented 4 years ago
options("esquisse.coerceVars" = TRUE)

try put this in your app.R file

sarthi2395 commented 4 years ago

Tried. Does not work!

xiangnandang commented 4 years ago

It worked for me: image

only change is the single line I suggested

library(shiny)
library(esquisse)
options(shiny.maxRequestSize = 30*1024^2)
options("esquisse.coerceVars" = TRUE)

ui <- fluidPage(
  esquisserUI(
    id = "esquisse", 
    header = FALSE,
    choose_data = TRUE,
    container = esquisseContainer(fixed = TRUE)
  )
)

server <- function(input, output, session) {

  data_r <- reactiveValues(data = data.frame(), name = "default")

  callModule(module = esquisserServer, id = "esquisse", data = NULL, dataModule = "ImportFile", sizeDataModule="l")

}

shinyApp(ui, server)
xiangnandang commented 4 years ago

could you make sure you have the most updated version installed (ideally from install_github)?

sarthi2395 commented 4 years ago

I do have. Removing and adding the package back and adding options("esquisse.coerceVars" = TRUE) seems to have fixed it. Thanks!