Skip to content

Instantly share code, notes, and snippets.

@daranzolin
Created July 29, 2016 04:15
Show Gist options
  • Save daranzolin/ff24651c23c42e616c18cf9840a1c91f to your computer and use it in GitHub Desktop.
Save daranzolin/ff24651c23c42e616c18cf9840a1c91f to your computer and use it in GitHub Desktop.
library(shiny)
library(miniUI)
makeStringsGadget <- function(...) {
ui <- miniPage(
gadgetTitleBar("Type your strings freely!"),
miniContentPanel(
textInput("sep", "Separator:"),
textInput("text", "Strings:")
)
)
server <- function(input, output, session) {
observeEvent(input$done, {
returnValue <- unlist(strsplit(as.character(input$text), split = input$sep))
stopApp(returnValue)
})
}
runGadget(ui, server)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment