This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| library(RCurl) # for base64Decode(), base64Encode(), getURLContent(), and getCurlHandle() | |
| library(digest) # for hmac() | |
| library(RJSONIO) # for toJSON() and fromJSON() | |
| api.key <- "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" | |
| secret <- "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" | |
| passphrase <- "your passphrase" | |
| api.url <- "https://api.gdax.com" | |
| req.url <- "/orders" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| set.seed(42) | |
| dat <- rnorm(1) | |
| shinyServer(function(input, output) { | |
| fetchData <- reactive(function() { | |
| invalidateLater(1000) | |
| qt <- rnorm(1) | |
| dat <<- c(dat, qt) | |
| dat | |
| }) | |
| output$plot_dat <- reactivePlot(function() { plot(fetchData(), type='l') }) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Based on (more) code by Joe Cheng: | |
| # https://groups.google.com/d/msg/shiny-discuss/NE-LqDAVqQQ/kNdrtC4WxGAJ | |
| # https://gist.github.com/4044364 | |
| #------------------------------------------------------------------------------- | |
| if (!require(TFX) && !require(TrueFX)) { | |
| stop("TFX must be installed; run 'install.packages(\"TFX\")'.\n") | |
| } | |
| shinyServer(function(input, output, session) { | |
| output$currentTime <- renderText({ | |
| # Forces invalidation in 1000 milliseconds |