R shiny code being used is:
library(shiny)
library(shinyBS)
ui <- fluidPage(
headerPanel( list(tags$head(tags$style("body {background-color: #F4F6F6 ; }")))),
titlePanel("RADP CR Prediction Tool"),
br(),
tags$head(tags$script(src = "message-handler.js")),
textInput('Region', label = 'Enter the region'),
textInput('Regulatory', label = 'Enter the regulatory status'),
textInput('Description', label = 'Enter the description for the CR'),
br(),
br(),
actionButton("goButton", "Go!"),
mainPanel(textOutput('region'),textOutput('description')),
bsModal("modalExample", "Your summary", "goButton", size = "large",dataTableOutput("data_summary"))
)
server <- function(input,output,session) {
#observe the add click and perform a reactive expression
observeEvent( input$goButton,{
x <- input$Region
y <- input$Regulatory
z<- input$Description
print (x)
system("/Users/ravinderbhatia/anaconda/bin/python /Users/ravinderbhatia/Downloads/Untitled3.py input[[x]] ,'y', 'z'")
MyData <- read.csv(file="/Users/ravinderbhatia/Downloads/data.csv", header=TRUE)
#reactive expression
output$region <- renderPrint(x)
output$description <-renderPrint(y)
output$data_summary <- renderDataTable({
MyData
})
}
)
}
shinyApp(ui, server)
Issue is in the follwing line:
system("/Users/ravinderbhatia/anaconda/bin/python /Users/ravinderbhatia/Downloads/Untitled3.py x,y,z")
How to pass the actual value of region in the system call. Here print(x) works fine, but when I pass x as a argument, I want to pass the value stored inside it.(input$region)