Monthly Archives: October 2011

Copy all the files in a directory to a new directory using R

October 27, 2011
By
Copy all the files in a directory to a new directory using R

Someone asked me how to move a directory full of files from one place to another using R.  The easiest way I've found is as follows (where "oldpath" is the existing directory and "newpath" is the new directory):file.copy(list.files(oldpath),newpath)

Read more »

A New Dimension to Principal Components Analysis

October 27, 2011
By
A New Dimension to Principal Components Analysis

In general, the standard practice for correcting for population stratification in genetic studies is to use principal components analysis (PCA) to categorize samples along different ethnic axes.  Price et al. published on this in 20...

Read more »

The Most Diversified or The Least Correlated Efficient Frontier

October 27, 2011
By
The Most Diversified or The Least Correlated Efficient Frontier

The “Minimum Correlation Algorithm” is a term I stumbled at the CSS Analytics blog. This is an Interesting Risk Measure that in my interpretation means: minimizing Average Portfolio Correlation with each Asset Class for a given level of return. One might try to use Correlation instead of Covariance matrix in mean-variance optimization, but this approach,

Read more »

RStudio Update

October 27, 2011
By
RStudio Update

With R 2.14 slated to be released next week we wanted to encourage everyone planning to upgrade to also update to the latest release of RStudio (v0.94.110). For R 2.14 users this release includes tweaks related to compatibility with the R 2.14 graphics engine as well as compatibility with the new parallel package. There are

Read more »

Two new rOpenSci R packages are on CRAN

October 27, 2011
By
Two new rOpenSci R packages are on CRAN

Carl Boettiger, a graduate student at UC Davis, just got two packages on CRAN.  One is treebase, which which handshakes with the Treebase API.  The other is rfishbase, which connects with the Fishbase, although I believe just scrapes XML cont...

Read more »

Computing on the Language

October 27, 2011
By

And now for something a bit more esoteric…. I recently wrote a function to deal with a strange problem. Writing the function ended up being a fun challenge related to computing on the R language itself. Here’s the problem: Write a function that tak...

Read more »

Introduction to “Numerical Methods and Optimization in Finance”

October 27, 2011
By
Introduction to “Numerical Methods and Optimization in Finance”

The book is by Manfred Gilli, Dietmar Maringer and Enrico Schumann.  I haven’t actually seen the book, so my judgement of it is mainly by the cover (and knowing the first two authors). The parts of the book closest to my heart are optimization, particularly portfolio optimization, and particularly particularly portfolio optimization via heuristic algorithms.  … Continue reading...

Read more »

R Cookbook with examples

October 27, 2011
By
R Cookbook with examples

An R Cookbook can be found at http://code.ca-net.org/R%20Cookbook. It is a short web document presenting dozens of examples on - Accessing Database with packages RSQLite, RMySQL, RdbiPgSQL and RODBC; - Reading and Writing Data; - Date/Time variable; - Graphics; - … Continue reading →

Read more »

Copy all the files in a directory to a new directory using R

October 27, 2011
By

Someone asked me how to move a directory full of files from one place to another using R.  The easiest way I've found is as follows (where "oldpath" is the existing directory and "newpath" is the new directory):  file.copy(list.files(oldpath),newpath)  Tags:  R

Read more »

Shoe Consumption in the U.S. – GGPlot2 #1

October 26, 2011
By
Shoe Consumption in the U.S. – GGPlot2 #1

  This is the first in a series of blog posts in which I use the R package GGPlot2 to examine real world data. In this post, I construct a line graph of U.S. shoe consumption from 1995 to 2007. A recent survey conducted by Shop Smart magazine found that the average woman in the

Read more »