However, I need to limit my previous wording
Although perfect on R Studio, it fails on R shiny
My input "algo" is variable on R Shiny (input$index)
For clarifying, here is an extract of my code:
ui:
ui <- fluidPage(
fluidRow(column(width = 12,
textInput("Intext",
label = h1("Enter here after:"),
value = "")),
),
textOutput("mytext"),
fluidRow(column(width = 12,
br(),
submitButton(h2("Predict")),
br())
),
textOutput("Intext2"),
)
server:
tri <- data.frame( n= c(15,25), unigram =c("wait see city", "wait and see"))
server <- function(input, output) {
#input_vector <- reactive(({input$Intext}))
output$mytext <- renderText({
input$Predict
input$Intext
})
output$Intext2 <- renderText({
algo <- input$index
#algo <- "wait see"
expr <-paste(algo, "%")
sen <- glue::glue('select * from tri where unigram like "', expr, '"')
sql <- sqldf ::sqldf(sen)
paste("The algorithm proposes now:", sql[1,2])
})
}
shinyApp(ui = ui, server = server)
Thanks for any suggestions on this ! 