Articles by is.R()

To plot them is my real test

March 31, 2013 | is.R()

I almost couldn’t bring myself to post this, but it’s April Fools’ Day, so I’ll never have a better opportunity. This Gist shows how to scrape “stats” and .PNG images from, erm, Bulbapedia, run a simple dimensionality reduction on those “stats,” and plot all 151 original Pokemon. I ... [Read more...]

MeRRy ChRistmas! (from is.R())

December 25, 2012 | is.R()

Merry Christmas is.R() readers! Thanks for accompanying us through an excellent first semester of R blogging, and for your feedback and enthusiasm. To celebrate, we’ve built an image mosaic from the shiny, happy avatars of our over 600 (!) Twitter followers. Click for a beautiful mosaic! We’ll be back ... [Read more...]

Latent Class Analysis with poLCA

December 24, 2012 | is.R()

On an airplane the other day, I learned of a method called latent class (transition) analysis, and it sounded like an interesting thing to try in R. Of course, as with everything R, There is a Package for That, called poLCA, written by none other than Drew Linzer (of Votamatic ... [Read more...]

Measuring the Gerrymander with spatstat

December 23, 2012 | is.R()

Well, to be specific, I mean measuring district compactness (a very interesting subject, see these three articles for starters). There are myriad ways of measuring the “oddness” of a shape, including a comparison of the area of the district to its circumcircle, the moment of inertia of the shape, the ... [Read more...]

The definitive guide to plotting confidence intervals in R

December 22, 2012 | is.R()

Here at is.R(), we have produced countless posts that feature plots with confidence intervals, but apparently none of those are easy to find with Google. So, today, for the purposes of SEO, we’ve put “plotting confidence intervals” in the title of our post. We also cannot resist an ... [Read more...]

Beautiful network diagrams with ggplot2

December 21, 2012 | is.R()

I don’t usually like describing my own work as “beautiful,” but with your permission I will make an exception today. There have been some requests for scripts illustrating the plotting of network diagrams with ggplot2, and today (for the winter solstice) we’re bringing you a really nice-looking way ... [Read more...]

Geocoding location data with dismo

December 20, 2012 | is.R()

Today’s Gist could actually end up being very useful to a number of you. It’s something of a trumped-up example, but it illustrates in very simple code how to do three interesting things: Gather Tweets by search term (which we’ve done before), and look up user info ... [Read more...]

Finding Numeric Values of Strings using strsplit()

December 19, 2012 | is.R()

Given a random list of words, can you find which has the lowest or highest numerical value when we apply a basic number:letter cipher?  A while back I asked David how he would solve this problem: Today’s post shows how to take a vector ... [Read more...]

Making prettier network graphs with sna and igraph

December 18, 2012 | is.R()

We’ve had some requests for ideas about how to make prettier network graphs, so here is one example, using the sna package for plotting, and the igraph package to calculate PageRank. The help file for gplot is pretty self-explanatory, but Melissa Clarkson has produced the most thorough and impressive ... [Read more...]

Text analysis made too easy with the tm package

December 15, 2012 | is.R()

Today’s Gist takes the CNN transcript of the Denver Presidential Debate, converts paragraphs into a document-term matrix, and does the absolute most basic form of text analysis: a raw word count. There are actually quite a few steps in this proc... [Read more...]

Fuzzy clustering with fanny()

December 13, 2012 | is.R()

This is kind of a fun example, and you might find the fuzzy clustering technique useful, as I have, for exploratory data analysis. In this Gist, I use the unparalleled breakfast dataset from the smacof package, derive dissimilarities from breakfast it... [Read more...]

Multidimensional metric unfolding with SMACOF

December 12, 2012 | is.R()

SMACOF stands for “Scaling by MAjorizing a COmplicated Function,” and it is a multidimensional scaling algorithm for metric unfolding of, among other things, rectangular ratings matrices. One neat Political Science application of MDS is i... [Read more...]

US State Maps using map_data()

December 11, 2012 | is.R()

Today’s short post will show how to make a simple map using map_data(). Let’s assume you have data in a CSV file that may look like this: Notice the lower case state names; they will make merging the data much easier. The variable of inte... [Read more...]

Handling missing data with Amelia

December 9, 2012 | is.R()

So, what if you have data, but some of the observations are missing? Many statistical techniques assume no missingness, so we might want to “fill in” or rectangularize our data, by replacing missing observations with plausible substitutes.... [Read more...]

Evaluating term popularity with twitteR

December 8, 2012 | is.R()

I really wanted to put something together for this series on the twitteR package. Unfortunately, at the moment the number of interesting things than can be done with twitteR, as opposed to through API calls and RCurl, is limited. Regardless, I have Ye... [Read more...]

Dot-density maps with spsample()

December 7, 2012 | is.R()

Today’s example is a little odd, in that the code isn’t pretty and the example isn’t really something you’d actually produce in real life — but if you’ll overlook those oddities, you’ll find that the spsample(... [Read more...]
1 2 3 4

Never miss an update!
Subscribe to R-bloggers to receive
e-mails with the latest R posts.
(You will not see this message again.)

Click here to close (This popup will not appear again)