Posts Tagged ‘ visualization ’

Comparison of plots using Stata, R base, R lattice, and R ggplot2, Part I: Histograms

September 21, 2009
By

One of the nicer things about many statistics packages is the extremely granular control you get over your graphical output.  But I lack the patience to set dozens of command line flags in R, and I'd rather not power the computer by pumping the mouse trying to set all the clicky-box options in Stata's graphics editor.  I want something...

Read more »

Locate the position of CRAN mirror sites on a map using Google Maps

August 5, 2009
By
Locate the position of CRAN mirror sites on a map using Google Maps

Inspired by this post (suggested here by the always useful Revolutions blog), I attempted to plot the position of CRAN mirrors on a map taking advantage of the nice R package RgoogleMaps (check the dependencies!). Below the code: library(XML) # downlo...

Read more »

Simple visualization of a 11X5 table (for WordPress 2.9 Features Vote Results)

July 31, 2009
By
Simple visualization of a 11X5 table (for WordPress 2.9 Features Vote Results)

I guess this is not the number one post I would like to start with on this blog, but I feel the time is right for it (community-wise). I’ll move on to the subject matter in a moment, but first a short intro: This blog is written by Tal Galili. I am ...

Read more »

ggplot2: more wicked-cool plots in R

July 20, 2009
By

As far as I know there are 3 different systems for producing figures in R: (1) base graphics, included with R, (2) the lattice package, and (3) ggplot2, one of the newer plotting systems which is, according to the creator Hadley Wickham, "based on the grammar of graphics, which tries to take the good parts of base and lattice...

Read more »

open-source campaign finance analysis with R and MySQL

June 18, 2009
By
open-source campaign finance analysis with R and MySQL

Introduction In Part 1 of this tutorial we introduced the fechell library by extracting all itemized contributions from individuals made to the Obama For America campaign in 2007 and 2008. In Part 2 of the tutorial we will summarize that data set by importing it into a MySQL database and aggregating contributions by week and

Read more »

Hierarchical Clustering in R

June 16, 2009
By

Hierarchical clustering is a technique for grouping samples/data points into categories and subcategories based on a similarity measure. Being the powerful statistical package it is, R has several routines for doing hierarchical clustering. The basic command for doing HC is hclust(d, method = "complete", members=NULL) Nearly all clustering approaches use a concept of distance. Data points

Read more »

Two plot with a common legend – base graphics

June 6, 2009
By
Two plot with a common legend – base graphics

If you need to share a common legend between two graphs using the ggplot2 package/paradigm take a look at this post from the Learning R blog.The code below solves the same task using the R base graphics.png( "2plot1legend.png", width = 480, height = 68...

Read more »

Use meaningful color schemes in your figures

June 3, 2009
By

Some of the best figure design ideas come from cartographers. If you've ever read a Tufte book you've seen lots of examples. Let's talk about using color effectively. Penn State geography professor Cindy Brewer's ColorBrewer tool for selecting color schemes for figures has been conveniently packaged into an R library called RColorBrewer. You'll have to read up...

Read more »

Alternative implementations using ggplot2

March 25, 2009
By
Alternative implementations using ggplot2

Here and here, you can find alternative implementations of two plots  (1, 2) I created time ago using R basic graphic. The author recreates the plots taking advantage of the excellent ggplot2 package.

Read more »

Comparison of different circle graphs

March 24, 2009
By

See in my Picasa here and get corrplot package here. Thanks Bob O'Hara's advice:)I found people's tastes differ, so input parameter col (fill color) and bg (background color) was added in new edition. What is more, now you can order your variables usin...

Read more »