This file contains 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
if (!require(quantmod)) { | |
stop("This app requires the quantmod package. To install it, run 'install.packages(\"quantmod\")'.\n") | |
} | |
# Download data for a stock if needed, and return the data | |
require_symbol <- function(symbol, envir = parent.frame()) { | |
if (is.null(envir[[symbol]])) { | |
envir[[symbol]] <- getSymbols(symbol, auto.assign = FALSE) | |
} |
This file contains 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
/* | |
Android Breath v0.2 | |
Simulates led breathing found on Android devices. | |
Tested with Arduino Nano ATmega328. | |
Cesar Schneider <cesschneider@gmail.com> | |
https://gist.github.com/cesschneider/7689698 | |
*/ | |
// Pin 13 has an LED connected on most Arduino boards. |
This file contains 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
#Run hclust | |
hc <- hclust(dist(USArrests[1:40,]), "ave") | |
#Function for extracting nodes and links | |
extractGraph<-function(hc){ | |
n<-length(hc$order) | |
m<-hc$merge | |
links<-data.frame(source=as.numeric(), target=as.numeric(), value=as.numeric()) |