# Posts Tagged ‘ visualization ’

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

August 5, 2009
By

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...

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

July 31, 2009
By

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 ...

## 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...

## open-source campaign finance analysis with R and MySQL

June 18, 2009
By

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

## 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

## Two plot with a common legend – base graphics

June 6, 2009
By

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...

## 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...

## Alternative implementations using ggplot2

March 25, 2009
By

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.

## 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...

## Visulization of correlation matrix

March 12, 2009
By

Color Imagedata(mtcars)fit = lm(mpg ~ ., mtcars)cor = summary(fit, correlation = TRUE)\$correlationcor2 = t(cor)colors = c("#A50F15", "#DE2D26", "#FB6A4A", "#FCAE91", "#FEE5D9","white", "#EFF3FF", "#BDD7E7", "#6BAED6", "#3182BD", "#08519C")image(1:11, 1:11, cor2, axes = FALSE, ann = F, col = colors)text(rep(1:11, 11), rep(1:11, each = 11), round(100 * cor2))Ellipseslibrary(ellipse)col =