Friday, August 19, 2011

display time series data in R

Thanks to the Revolutions blog, several things learned here:
1. R code for heat calendar
2. generate SVG from R
3. pretty-R tool

OK. Let's explain it by plotting the fund WASCX (IVY ASSET STRATEGY FUND CLASS C) from 2009-03-14:
# source code of calendarHeat (by Paul Bleicher)
# fetch stock time series data from Yahoo finance
stock <- "WASCX" <- "2009-03-14" <- Sys.Date()
quote <- paste("",
                "&a=", substr(,6,7),
                "&b=", substr(, 9, 10),
                "&c=", substr(, 1,4), 
                "&d=", substr(,6,7),
                "&e=", substr(, 9, 10),
                "&f=", substr(, 1,4),
                "&g=d&ignore=.csv", sep="")     <- read.csv(quote,
# display in SVG format
  varname="WASCX Adjusted Close")
Created by Pretty R at

No comments:

Post a Comment