2012-9 Writing grid Extensions

November 6, 2012
By

New hook functions, makeContext() and makeContent(), have been added to the grid graphics package. These functions allow an alternative approach to developing custom grobs when a grob can only decide what to draw at drawing time rather than when the … Continue reading →

Read more »

rfigshare tutorial

November 6, 2012
By

Recently we at rOpenSci released our rfigshare package up on cran (or you can check out the most up to date version on github. So what’s so great about being able to create figshare articles through R? For some time now I’ve been advocating the use of a workflow that involves documents written in R...

Read more »

R BLAS: GotoBLAS2 vs OpenBLAS vs MKL

November 6, 2012
By
R BLAS: GotoBLAS2 vs OpenBLAS vs MKL

Short update to Speed up R by using a different BLAS implementation/: MKL is overall the fastest OpenBLAS is faster than its parent GotoBLAS and comes close to MKL A = matrix(rnorm(n*n),n,n) A %*% A solve(A) svd(A)

Read more »

Reverse engineering the SAS data file format

November 6, 2012
By
Reverse engineering the SAS data file format

I think it’s rather marvellous that a few expert coders are working on dispelling the cloud of mystery around the proprietary file format used by SAS software. Essentially, saving your data in a SAS format (with a name like mydata.sas7bdat) … Continue reading →

Read more »

EPS Market Map in R

November 6, 2012
By
EPS Market Map in R

There are a few minor tweaks renaming on this map before it is complete, but I wanted to share the EPS Market Map I put together.  It can be downloaded using this link. This file is meant to be used with R and divides the lower 48 states into the CollegeBoard’s Enrollment Planning Service markets.

Read more »

ggplot graphs in publications?

November 6, 2012
By
ggplot graphs in publications?

The grey background and/or default choice of colours for groups makes a ggplot graph stand out to any R user when seen in a presentation. But ggplot graphs get all ninja when it comes to publications, either that or not … Continue reading →

Read more »

Forest plots in R (ggplot) with side table

November 6, 2012
By
Forest plots in R (ggplot) with side table

A friend asked me to help with a forest plot recently. After chatting about what she wanted the end result to look like, this is what I came up with. grid.arrange(data_table, p, ncol=2) ## Warning: Removed 1 rows containing missing … Continue reading →

Read more »

analyze the national survey on drug use and health (nsduh) with r

November 6, 2012
By

the national survey on drug use and health (nsduh) monitors illicit drug, alcohol, and tobacco use with more detail than any other survey out there.  if you wanna know the average age at first chewing tobacco dip, the prevalence of needle-sharing,...

Read more »

Simulating Multiple Asset Paths in R

November 5, 2012
By
Simulating Multiple Asset Paths in R

I recently came across the Optimal Rebalancing Strategy Using Dynamic Programming for Institutional Portfolios by W. Sun, A. Fan, L. Chen, T. Schouwenaars, M. Albota paper that examines the cost of different rebablancing methods. For example, one might use calendar rebalancing: i.e. rebalance every month / quarter / year. Or one might use threshold rebalancing:

Read more »

Quick Post About Getting and Plotting Polls in R

November 5, 2012
By
Quick Post About Getting and Plotting Polls in R

With the election nearly upon us, I wanted to share an easy way I just found to download polling data and graph a few with ggplot2. dlinzer at github created a function to download poll data from the Huffington Post's Pollster API.The default is to dow...

Read more »

Another look at ideology of the US congress

November 5, 2012
By
Another look at ideology of the US congress

In response to last week's post on the rapidly increasing ideology of the US Republican Party, Mike Lawrence suggested another way of looking at the DW-NOMINATE ideology data. Rather than simply looking at boxplots of the congress scores by party over time, we could fit a smooth curve to get a better sense of the trends over time. Mike...

Read more »

RInside 0.2.9

November 5, 2012
By

A new version 0.2.9 of RInside arrived on CRAN earlier today; Windows binaries have already been built too. RInside provides a set of convenience classes which facilitate embedding of R inside of C++ applications and programs, using the classes and ...

Read more »

OOP with Rcpp modules

November 5, 2012
By
OOP with Rcpp modules

The purpose of Rcpp modules has always been to make it easy to expose C++ functions and classes to R. Up to now, Rcpp modules did not have a way to declare inheritance between C++ classes. This is now fixed in the development version, and t...

Read more »

Network visualization in R with the igraph package

November 5, 2012
By
Network visualization in R with the igraph package

In this post I showed a visualization of the organizational network of my department. Since several people asked for details how the plot has been produced, I will provide the code and some extensions below. The plot has been done … Continue reading →

Read more »

If we truly want to foster collaboration, we need to rethink the “independence” criteria during promotion

November 5, 2012
By

When I talk about collaborative work, I don’t mean spending a day or two helping compute some p-values and end up as middle author in a subject-matter paper. I mean spending months working on a project, from start to finish, with experts … Continue reading →

Read more »

Retrieving the VIX term structure in R

November 5, 2012
By

  Much of my time lately has gone into analyzing and trading products in the volatility complex.  As a result, I regularly watch the VIX term structure for continuations or deviations from trend.  To make analysis simpler, I’ve written some… Read more ›

Read more »

Multi-stage sampling together with hierarchical/ mixed effects models: which packages?

November 5, 2012
By

Dear R experts, I sent this question to the r-help list but didn’t get much response, probably because it is more of a stats question. But as this blog is syndicated on r-bloggers I thought I would try it again here on this blog. If I am barking up the wrong tree, feel free to

Read more »

Plotting letters as shapes in ggplot2

November 5, 2012
By
Plotting letters as shapes in ggplot2

This post is a little more esoteric than most, but I found myself needing to solve this problem, so I’m just passing the solution on to you. The plot above shows the distribution of DW-NOMINATE scores for the 18th Congress, with party indicated ...

Read more »

An easy mistake with returns

November 5, 2012
By
An easy mistake with returns

When aggregating over both time and assets, the order of aggregation matters. Task We have the weights for a portfolio and we want to use those and a matrix of returns over time to compute the (long-term) portfolio return. “A tale of two returns” tells us that aggregation over time is easiest to do in … Continue reading...

Read more »

Why the 2012 US elections are more exciting than 2008

November 4, 2012
By
Why the 2012 US elections are more exciting than 2008

Here’s an addition to my last post on using Wikipedia data to analyse attention for the US presidential elections 2012. Here’s another look at the interest not for the candidates’ Wikipedia pages but the general pages for the elections 2008 and 2012. Compared to the candidates’ pages, the attention for the general

Read more »

Picturing Trees

November 4, 2012
By
Picturing Trees

  In this post I like to illustrate the R package “ape” for phylogenetic trees for the purpose of assembling trees. The function read.tree creates a tree from a text description. For example the following code creates and displays two … Continue reading →

Read more »

Finishing football postings

November 4, 2012
By

For now this is the last post about these football data. It started in August, by now it is November. But just to finish up; the model as it should have been last week.ModelAs most of what I did is described last week, only the model as it went in Jags...

Read more »

Sunday Data/Statistics Link Roundup (11/4/12)

November 4, 2012
By

Brian Caffo headlines the WaPo article about massive online open courses. He is the driving force behind our department’s involvement in offering these massive courses. I think this sums it up: `“I can’t use another word than unbelievable,” Caffo said. … Continue reading →

Read more »

Hello World!

November 4, 2012
By

Eventually this will be a blog about a reformed physicist's forays into data analysis in the world of finance. I'll be using R, Python, d3 and anything else I can get my hands on to serve up some tasty nuggets of data!

Read more »

Plotting large amounts of atmospheric data

November 4, 2012
By

Plotting large amounts of hourly atmospheric data body, td { font-family: sans-serif; background-color: white; font-size: 12px; margin: 8px; } tt, code, pre { font-family: 'DejaVu Sans Mono', 'Droid Sans Mono', 'Lucida Console',...

Read more »

Wikipedia Attention and the US elections

November 3, 2012
By
Wikipedia Attention and the US elections

One of the most interesting challenges of data science are predictions for important events such as national elections. With all those data streams of billions of posts, comments, likes, clicks etc. there should be a way to identify the most important correlations to make predictions about real-world behavior such as: going to the voting booth

Read more »

Generation of a normal distribution from "scratch" – The box-muller method

November 3, 2012
By
Generation of a normal distribution from "scratch" – The box-muller method

My previous post is about a method to simulate a Brownian motion. A friend of mine emailed me yesterday to tell me that this is useless if we do not know how to simulate a normally distributed variable. My first remark is: use the rnorm() function if t...

Read more »

Reordering factor levels in R plots

November 3, 2012
By
Reordering factor levels in R plots

A few days ago a post doctoral researcher asked me if I could help him reorder the factor levels on a bar chart. The problem is that R automatically alphabetizes factor levels. I thought this would be fairly straight-forward but...

Read more »

Project Euler — problem 21

November 3, 2012
By
Project Euler — problem 21

It’s been over one month since my last post on Euler problem 20, when  I was planning to post at least one on either Euler project or visualization. So I am four posts behind; I’ll try to catch up. Tonight, I’ll solve the 21st Euler … Continue reading →

Read more »

Sponsors

Mango solutions





RStudio homepage

Zero Inflated Models and Generalized Linear Mixed Models with R

Quantide: statistical consulting and training



http://www.eoda.de









ODSC

CRC R books series













Contact us if you wish to help support R-bloggers, and place your banner here.