Skip to content

Instantly share code, notes, and snippets.

@dataminelab
Created April 5, 2015 12:07
Show Gist options
  • Save dataminelab/47c146c941cdc2f4069f to your computer and use it in GitHub Desktop.
Save dataminelab/47c146c941cdc2f4069f to your computer and use it in GitHub Desktop.
library(quantmod)
getSymbols(c("^VIX"))
vix = AAPL[,"VIX.Adjusted"]
vix.hash = apply(vix, 2, function(col) sapply(col, digest, algo="md5"))
vix.hash = apply(vix.hash, 2, function(col) { as.numeric(paste("0x", col, sep="")) / 15e+38 } )
old.par <- par(mfrow=c(1, 2))
plot(vix, ylim=c(10, 120), ylab='')
plot(vix.hash, ylim=c(0, 1), ylab='')
par(old.par)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment