Created
May 11, 2012 17:24
-
-
Save tjake/2661144 to your computer and use it in GitHub Desktop.
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
#Load RJDBC | |
library(RJDBC) | |
#Load in the Cassandra-JDBC diver | |
cassdrv <- JDBC("org.apache.cassandra.cql.jdbc.CassandraDriver", | |
list.files("/Users/jake/workspace/bdp/resources/cassandra/lib/",pattern="jar$",full.names=T)) | |
#Connect to Cassandra node and Keyspace | |
casscon <- dbConnect(cassdrv, "jdbc:cassandra://localhost:9160/PortfolioDemo") | |
#Query timeseries data | |
res <- dbGetQuery(casscon, "select * from StockHist limit 10") | |
#Transpose | |
tres <- t(res[2:10]) | |
#Plot | |
boxplot(tres,names=res$KEY,col=topo.colors(length(res$KEY))) | |
title("BoxPlot of 10 Stock Price Histories") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment