BookmarkSubscribeRSS Feed
ManuelaVila
Fluorite | Level 6

Hi im transferring an R code to sas using the "submit / R;" of IML. My code has a shiny app and when i try to run it, it doesnt give me an error but it never stops running:Anotación 2020-06-29 112231.png

 

 Heres a simple example of what im trying to do

 

proc iml;
print "-------------  R Results  --------------------";
submit / R;




  library(dplyr)
  library(lubridate)
  library(shiny)
  ui <- fluidPage(
    "The population of France in 1972 was",
    textOutput("answer")
)

# Define the server function
server <- function(input, output) {
    output$answer <- renderText({
        
        "50,763,920"  })
}
endsubmit;

 

 

thanks!

3 REPLIES 3
Tom
Super User Tom
Super User

It doesn't make much sense to try to call Shiny from SAS.  Shiny is a tool for making a WEBPAGE.  Did you want SAS to open a URL in a browser to look at the webpage that Shiny is building?

 

Instead look at the actual R functions that your Shiny app is calling and just call those in the R code you submit via PROC IML.

What types of output does your R function generate? How do you want to return that to SAS?  

ManuelaVila
Fluorite | Level 6

i need the shiny app because in there i select the variables i need based on a reactive graph that changes depending of what i choose.

Reeza
Super User
Shiny apps require a running R server to host them, which is usually the R Installation or they're hosted elsewhere. They do not generate a self hosting HTML page so I'm not sure that this approach would work at all.

https://shiny.rstudio.com/tutorial/written-tutorial/lesson7/

sas-innovate-white.png

Missed SAS Innovate in Orlando?

Catch the best of SAS Innovate 2025 — anytime, anywhere. Stream powerful keynotes, real-world demos, and game-changing insights from the world’s leading data and AI minds.

 

Register now

Mastering the WHERE Clause in PROC SQL

SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 3 replies
  • 1725 views
  • 0 likes
  • 3 in conversation