Publications by C
Chart the U.S. Gross National Product with the Federal Reserve API
The Federal Reserve of St. Louis has an amazing amount of economic data available through their API. You need to apply for an API key, and once you have been approved you include your API key as URL parameter to access your data. api_key=’YOUR API KEY HERE‘Once you have completed this step, the code below will parse the data and produce a g...
1481 sym 4 img
Occupational Wage Comparison Plotted in R
Ever have conversations with your kids about what they are going to do with their life? Still trying to figure out what you are going to do with yours?Best to not starve…The chart above represents the percentage of each occupation that earn a given hourly wage. The range below represents annual salaries from less than $23,920 (11.50 * 20808) t...
2371 sym 6 img
R Layout command.
In the previous post I created a chart but could not figure out to fit the legend in the chart area. Peter Carl pointed me to the layout command which partitions the display area and allowed the the legend to be included. Source code to produce the chart above is as follows.library(XML)url=’http://www.bls.gov/oes/current/distribution_table.ht...
2325 sym 6 img
World Bank API R package available!
In previous posts I demonstrated R plots created using World Bank Data through their API. The following is a much nicer example of what is possible. Many thanks to Vincent Arel-Bundock for sharing his work to make the World Bank Development Indicator API data available as an R package! He also provided comments in a previous post that sho...
1535 sym 4 img
Stock Analysis using R
Want to do some quick, in depth technical analysis of Apple stock price using R? Theres a package for that!The Quantmod package allows you to develop, testing, and deploy of statistically based trading models. It provides the infrastructure for downloading/importing data from a variety of locations, analyze that data and produce cha...
2563 sym 4 img 4 tbl
Analyze Twitter Data Using R
Twitter data available through its API provides a wealth of real time information. This article demonstrates a graph of user relationships and an analysis of tweets returned in a search using R. Keep in mind, Twitter has announced that basic authentication removal is going to occur on August 16, 2010. I am not sure how this code will work a...
4382 sym 14 img
Analyze Gold Demand and Investments using R
After the recent foray into stock analysis using quantmod, I thought it worthwhile to mention that the library can be used to analyze a wide variety of investments, including precious metals. It is also worthwhile to mention that there are other possibilities for using R related to investment research that do not fit as neatly into the paradigm...
6487 sym 16 img 2 tbl
CRAN Search
Here’s a ditty to search the cran R packages by descriptioncranSearch = function(q=”){ library(XML) u d d[[1]]$V1 lib.names lib.descriptions lib.names[grep(q,lib.descriptions)]}So to search for all packages that have XML in the description.cranSearch(‘XML’)The search is case sensitive.cranSearch(‘World Bank’)In ...
769 sym 4 img
Happy 4th of July
library(maps)states plot(states, type = “l”, col = “navy”, axes = FALSE, xlab = “”, ylab = “”)title(“Happy 4th of July”, col.main = “red”) Related To leave a comment for the author, please follow the link and comment on their blog: R-Chart. R-bloggers.com offers daily e-mail updates about R news and tutorials about l...
529 sym 4 img
Make R speak SQL with sqldf
The R community is unique as programming communities go. Many users of R come from academia and have a relatively extensive mathematical background. The R community has developed in relative isolation from some other areas of programming that have been widely adopted by business. To many business users, working with data is synonymous with ...
5325 sym 6 img