4 ms·
rocks - in R, just library(quantmod) getSymbols("CPIAUCNS", src="FRED") then you can get nice graphs with something like library(ggplot2) CPIPCT = da
by RockyMcNuts 15y ago
rocks - in R, just
library(quantmod)
getSymbols("CPIAUCNS", src="FRED")
then you can get nice graphs with something like
library(ggplot2)
CPIPCT = data.frame(CPIAUCNS / lag(CPIAUCNS,12) * 100 -100)
CPIPCT$date= as.Date(rownames(CPIPCT))
CPIPCT <- tail(CPIPCT, 240)
CPI.m <- melt(CPIPCT, id = 'date')
ggplot(data=CPI.m, aes(x=date, y=value, colour=variable)) + ylab("YoY % Change") + theme_bw() + scale_x_date("") + geom_line(size=1.4) + opts(plot.background = theme_rect(colour = 'black', fill = '#CCCCEE', size = 1, linetype='solid'), legend.position="top") + scale_colour_manual("CPI", breaks=c("CPIAUCNS"), values = c("#0000CC"), labels=c('All Urban'))
or just get the graphs online with Fred Graph -
http://research.stlouisfed.org/fred2/graph/ http://research.stlouisfed.org/fred2/graph/
- 01PH 15y agoDo you have any recommendations for accessible R tutorials? I would love to get into this a little bit more. R seems quite effective for these kinds of things.
- RockyMcNuts 15y agoThese are a few in my bookmarks: Quick-R http://www.statmethods.net/index.html http://www.statmethods.net/index.html R for Programmers http://en.wikibooks.org/wiki/R_Programming http://en.wikibooks.org/wiki/R_Programming SurviveR http://www.win-vector.com/blog/2009/09/survive-r/ http://www.win-vector.com/blog/2009/09/survive-r/ Official intro http://cran.r-project.org/doc/manuals/R-intro.html http://cran.r-project.org/doc/manuals/R-intro.html Might depend on your definition of accessible LOL Stack Overflow also very helpful - http://stackoverflow.com/questions/tagged/r http://stackoverflow.com/questions/tagged/r Rseek http://www.rseek.org/ http://www.rseek.org/ R-Help http://r.789695.n4.nabble.com/R-help-f789696.html http://r.789695.n4.nabble.com/R-help-f789696.html
- RockyMcNuts 15y agomeant to post this one - R for Programmers - http://heather.cs.ucdavis.edu/~matloff/R/RProg.pdf http://heather.cs.ucdavis.edu/~matloff/R/RProg.pdf
- jamesbkel 15y agoNot a tutorial, but I found the R Graph gallery helpful. When I first got started I typically just poked around for something interesting, downloaded the source and started tweaking parameters and/or loading in new data sets. It can be daunting to create graphs from scratch in R without experience - I found these provided some good training wheels. http://addictedtor.free.fr/graphiques/ http://addictedtor.free.fr/graphiques/