Deploy with sparkR

Hello! Can we deploy an app with sparkR to shinyapps? I'm trying to publish this basic app below. It runs locally, but it's not published. Any suggestion to make it work?

Thanks in advance!


Sys.setenv(SPARK_HOME = "/opt/spark")
library(SparkR, lib.loc = c(file.path(Sys.getenv("SPARK_HOME"), "R", "lib")))

                   header = "true", 

ui <- fluidPage(

server <- function(input, output) {
    output$media <- renderTable({

# Run the application 
shinyApp(ui = ui, server = server)

Hi, @alefego , welcome to Community!

Right, bottom line is that SparkR is not on CRAN (CRAN - Package SparkR) So, there's no common source from which can pull from.

An alternative would be using sparklyr. As far as we know, there are no restrictions from running Spark in But since each session is containerized, then you need to install Spark every time the app starts, as in sparklyr::spark_install(). Also, you may need to ensure to explicitly set the Java memory size required for the app.

Having said all that, the main question is "why?". Is there something in Spark that is not available in R that you need? If so, can you share what that is? The cost of instantiating Spark for every app session seems to be a high price to pay, in performance terms, specially if the data conversion or model could be run using R