Posts Tagged ‘ R code ’

How to upgrade R on windows 7

April 15, 2011
By

Background – time to upgrade to R 2.13.0 The news of the new release of R 2.13.0 is out, and the R blogosphere is buzzing. Bloggers posting excitedly about the new R compiler package that brings with it the hope to speed up our R code with up to 4 times improvement. So it is time

Read more »

Le Monde puzzle [#8]

March 29, 2011
By
Le Monde puzzle [#8]

Another mathematical puzzle from Le Monde that relates to a broken calculator (skipping the useless tale): Given a pair of arbitrary positive integers (x,y) a calculator can either substract the same integer from both x and y or multiply either x or y by 2. Is it always possible to obtain equal

Read more »

Plotting Indifference Curves with R Contour Function

March 11, 2011
By
Plotting Indifference Curves with R Contour Function

The following post at Constructing Difference Curves - Part 3 from economics.about.com provides a discussion on indifference curves (but actually I think they are isoquants) and how to construct them. I think I have a grasp on how to do this in R if yo...

Read more »

Copula Functions, R, and the Financial Crisis

March 10, 2011
By
Copula Functions, R, and the Financial Crisis

From: In defense of the Gaussian copula, The Economist"The Gaussian copula provided a convenient way to describe a relationship that held under particular conditions. But it was fed data that reflected a period when housing prices were not correlated to the extent that they turned out to be when the housing bubble popped."Decisions about...

Read more »

Merging Multiple Data Frames in R

January 23, 2011
By
Merging Multiple Data Frames in R

Earlier I had a problem that required merging 3 years of trade data, with about 12 csv files per year. Merging all of these data sets with pairwise left joins using the R merge statement worked (especially after correcting some errors pointed out by Ha...

Read more »

Flexibility of R Graphics

January 21, 2011
By
Flexibility of R Graphics

(note scroll all the way down to see 'old code' and 'new more flexible code' Recall and older post that presented overlapping density plots using R (Visualizing Agricultural Subsidies by KY County) see image below.The code I used to produce this plot m...

Read more »

Posted Question for R Users

January 21, 2011
By
Posted Question for R Users

I recently undertook a project where a colleague had about 12 .csv files that they wanted to merge. Each file had a common (key) variable 'Partner' (which is trading partner) with differing columns (variables) except for the common key variable. Actual...

Read more »

R Code Documentation Template

January 15, 2011
By
R Code Documentation Template

# *------------------------------------------------------------------# | PROGRAM NAME: # | DATE: # | CREATED BY: # | PROJECT FILE: # *----------------------------------------------------------------# | PURPOSE: # |# *-------...

Read more »

R Code for googleVis Demo

January 12, 2011
By
R Code for googleVis Demo

# ------------------------------------------------------------------# | PROGRAM NAME: googleVis_R# | DATE: 1/12/11 # | CREATED BY: Matt Bogard# | PROJECT FILE: # |----------------------------------------------------------------# | PURPOSE: ...

Read more »

Visualizing Agricultural Subsidies by Kentucky County

December 12, 2010
By
Visualizing Agricultural Subsidies by Kentucky County

In this post,  I provide results from my first full blown application of R to read, merge, clean, subset, manipulate, analyze and visualize data related to agricultural subsidies by Kentucky counties. This is very similar to the work I do on a daily basis, and was a great test of the capabilities of doing these tasks open source...

Read more »