October 2012

The unicorn problem

October 13, 2012 | Matt Asher

Let’s say your goal is to observe all known species in a particular biological category. Once a week you go out and collect specimens to identify, or maybe you just bring your binoculars to do some spotting. How long will it take you to cross off every species on ... [Read more...]

Agreement between code readability ratings given by students

October 13, 2012 | Derek Jones

I have previously written about how we know nothing about code readability and questioned how the information content of expressions might be calculated. Buse and Weimer ran a very interesting experiment that asked subjects to rate short code snippets for readability (somebody please rerun this experiment using professional software developers). ... [Read more...]

Overfitting

October 13, 2012 | John Myles White

What do you think when you see a model like the one below? Does this strike you as a good model? Or as a bad model? There’s no right or wrong answer to this question, but I’d like to argue that models that are able to match white ... [Read more...]

How to choose the right *apply function

October 13, 2012 | is.R()

How to choose the right *apply function: This is an amazing stackoverflow answer to help you decide which of the many *apply functions (apply, lapply, sapply, vapply, mapply, rapply, tapply) is appropriate for the task at hand. I’m planning on doing... [Read more...]

Minute by Minute Twitter Sentiment Timeline from the VP debate

October 12, 2012 | stathack

Click on above graph to enlarge. Background The data for this graph was collected automatically every ~60 seconds of the VP debate on 10/11/2012, with an ending aggregate sample size of 363,163 tweets.  From this dataset duplicate tweets were removed (because of bots), which gave a final dataset of 81,124 remaining unique tweets (52,303-Biden, 28,821... [Read more...]

Color Palettes in HCL Space

October 12, 2012 | Jeff Allen

This is a quick follow-up to my previous post about Color Palettes in RGB Space. Achim Zeileis had commented that, perhaps, it would be more informative to evaluate the color palettes in HCL (polar LUV) space, as that spectrum more accurately describes how humans perceive color. Perhaps more clear trends ... [Read more...]

Creating SVG Plots from R

October 12, 2012 | Super User

I recently wanted to create a ggplot that I could then 'tweak' furthur. This is my solution, to create an .svg file which can be loaded into a suitable application (I prefer Inkscape) and furthur edited / tweaked. # Build an example Plotlibrary(ggplot2... [Read more...]

Nine lightning talks on R

October 12, 2012 | David Smith

At Tuesday's Bay Area R User Group meetup, nine speakers gave five-minute talks on various aspects of R. Revolution Analytics' Luba Gloukhov was one of the presenters, and also provides the summary of the talks below. Links to the slides are included where available for you to check out. Ariel ... [Read more...]

Overlay of design matrices in genetic analysis

October 12, 2012 | Luis

I’ve ignored my quantitative geneticist side of things for a while (at least in this blog) so this time I’ll cover some code I was exchanging with a couple of colleagues who work for other organizations. It is common to … Continue reading → [Read more...]

Using cairographics with ggsave()

October 12, 2012 | is.R()

Whenever possible, I try to save R graphic output in a vector format, typically pdf(). I also like to use the handy ggsave() function to do so, as it streamlines the process, and makes it easy to be consistent across formats. However, at times it is n... [Read more...]

Loading SPSS (.sav) into Stata

October 11, 2012 | Daniel

Most statistical softwares nowadays are able to convert their files to a wide range of other packages. Perhaps it is the reason for the discontinuity of old converter bundles like SAS Transport and DBMS. Interesting, however, Stata, a quite popular statistical package, still lack built-in support for exporting and importing ... [Read more...]

Download Stock Price Online with R

October 11, 2012 | statcompute

[This article was first published on Yet Another Blog in Statistical Computing » S+/R, and kindly contributed to R-bloggers]. (You can report issue about the content on this page here) Want to share your content on R-bloggers? click here if you have a blog, or here if you don't. library(chron) library(zoo) # STOCK TICKER OF Fifth Third Bancorp stock <- 'FITB' # DEFINE STARTING DATE start.date <- 1 start.month <- 1 start.year <- 2012 # DEFINE ENDING DATE end.date <- 11 end.month <- 10 end.year <- 2012 # DEFINE URL LINK link <- paste("http://ichart.finance.yahoo.com/table.csv?s=", stock, "&a=", as.character(start.month - 1), "&b=", as.character(start.date), "&c=", as.character(start.year), "&d=", as.character(end.month - 1), "&e=", as.character(end.date), "&f=", as.character(end.year), "&g=d&ignore=.csv", sep = '') # DOWNLOAD STOCK PRICE AS CSV FILE download.file(link, "c:/projects/data.csv") # READ THE CSV FILE INTO R data <- read.csv("c:/projects/data.csv") # CONVERT CHARACTER INTO DATE dt <- dates(as.character(data[, 1]), format = "y-m-d") # CONVERT DATA FRAME INTO TS OBJECT ts <- zoo(data[, 2:5], dt) # CREATE A PLOT FOR OPEN/CLOSE/HIGH/LOW PRICES plot(ts, main = stock) To leave a comment for the author, please follow the link and comment on their blog: Yet Another Blog in Statistical Computing » S+/R. R-bloggers.com offers daily e-mail updates about R [...] [Read more...]

Revolution Newsletter: September/October 2012

October 11, 2012 | David Smith

The most recent edition of the Revolution Newsletter is out. The news section is below, and you can read the full September/October edition (with highlights from this blog and community events) online. You can subscribe to the Revolution Newsletter to get it monthly via email. New R Courses Announced: ... [Read more...]

Random Name Generator in R

October 11, 2012 | Mollie

Just for the heck of it, let's recreate my Reality TV Show Name Generator in R. This isn't really the sort of thing you'd normally do in R, but we can try out a bunch of different functions this way: random integers/sampling, concatenation, sorting, an... [Read more...]

Pilot Study: Small Town Land Surface Temperature

October 11, 2012 | Steven Mosher

Introduction Zhang and Imhoff (2010)  pdf here utilized NLCD impervious surface area (ISA), Olson biomes, and MODIS Land Surface temperature (LST) to estimate the magnitude of UHI in large cities across the US.  Peng  employed a   similar approach in studying 419 large cities ( population greater than 1m ) around world. Peng’s work ... [Read more...]

From holey polygons to convex hulls

October 11, 2012 | is.R()

I only rarely have the occasion to need the convex hull of a set of points, but I love chull(), so I’d like to share an example of how to use it. This Gist also offers a pretty straightforward application of the Split-Apply-Combine strategy (see... [Read more...]

Curved arrows in R

October 10, 2012 | Karl Broman

I briefly investigated how to draw curved arrows in R. Here’s a small piece of the figure that I ultimately created: A google search for “curved arrows in R” revealed three options: curvedarrow in the diagram package The internal function igraph.Arrows within the igraph package (mentioned by Gabor ... [Read more...]
1 8 9 10 11 12 16

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)