Skip to content

Instantly share code, notes, and snippets.

@byzheng
Last active February 23, 2016 23:23
Show Gist options
  • Save byzheng/4eb8d48c8b258971329c to your computer and use it in GitHub Desktop.
Save byzheng/4eb8d48c8b258971329c to your computer and use it in GitHub Desktop.
A shiny app to add a hyperlink and send data back to server.
library(shiny)
shinyServer( function(input, output, session) {
output$results <- renderPrint({
input$mydata
})
})
library(shiny)
shinyUI( bootstrapPage(
# a div named mydiv
tags$a(
id="mydiv",
href="#", 'click me',
onclick = 'Shiny.onInputChange("mydata", Math.random());'),
# an element for unformatted text
verbatimTextOutput("results")
))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment