Q:

Use readlines(prompt = ) in Shiny

I have a code that takes inputs using the readlines(prompt = ) function. Could you tell me which input function in Shiny will be adequate to adapt this code to a Shiny app? 
I need an interactive function, I can't use a simple input with selectInput() because I have a lot of readlines(prompt = ) statements.
Something similar to this question:
 Include interactive function in shiny to highlight "readlines" and "print"

A:

Florian's answer is nice and easy to use, I would definitely recommend that! But in case you are keen on using prompts for inputs I am adding another solution, using javaScript:
This one shows a prompt when the user presses an actionButton and stores it in an input variable. (it doesn't necessarily have to be after a button press)
library(shiny)

ui <- fluidPage(
  tags$head(tags$script("
    $(document).on('shiny:inputchanged', function(event) {
      if (event.name === 'go') {
        var text = prompt('Write me something nice:');
        Shiny.onInputChange('mytext', text);
      }
    });"
  )),
  actionButton("go", "Click for prompt"),
  textOutput("txt")
)

server <- function(input, output, session) {
  output$txt <- renderText( {
    input$mytext
  })
}

shinyApp(ui, server)

