Hello,
Suppose the following: in the server, inside a renderPrint
component I will use shinijs::display("takeInput)
. This GUI component takes input from the user, so I will pass the input to a function by means of the function call. Afterwards, the function calls another function and sends the input to that function. The input will be received and tested by the second function. The result of the test will be returned to the first function which will return it to the server. Please see below:
Is there another way to do this? A simpler one? I would like to be able to use the second function program that takes in Input without modifications, but it seems that reaLines(prompt = ...) is not compatible with Shiny GUI display panel since readLines displays the question to take input in the terminal. I was wondering if there there is a way to display the readLines question in the GUI panel instead of in the terminal. A way of grabbing the reaLines function as it is and redirect its display from the terminal to the GUI panel
ui{
selectInput("xxxxx")
verbatimTextOutput(
}
source(program containing functionName)
source(program containing another function name)
functionName <- function(parameters, takeInput){
functionName2 <- anotherFunctionName(parameters, takeInput)
functionName2 <- valueOfFunctionName2
if(functionName2 == xx){
dosomthing
return the value to the server
list(functionName2 = functionName2)
}
anotherFunctionName<- function(parameters, takeInput){
if(takeInput == something){
return the value of anotherFunctionName to functionName which will return it to the server
valueOfFunctionName2
}
}
}
serverFunction({
output$value <- renderPrint({
result <- functionName(parameters)
if(something == FALSE)
shinyjs::show(xxxxx)
})
output$takeInput<- renderPrint({
takenInput <- input$xxxxx
result <- functionName(parameters, takeInput)
result$theValuereturnedby anotheFunctinName
})