Posts Tagged ‘ programming ’

Tools for Hacking R: Subversion

August 23, 2010
By

The development version of R is stored in a Subversion repository at the URL http://svn.r-project.org/R/trunk/. In fact, you can browse the source code by clicking the link. Subversion Hierarchy Subversion is software for source code revision control. That means it keeps track of changes, who made them, when they were made, and any comments about

Read more »

Abstract word clouds using R

August 23, 2010
By
Abstract word clouds using R

A recent question over at BioStar asked whether abstracts returned from a PubMed search could easily be visualised as “word clouds”, using Wordle. This got me thinking about ways to solve the problem using R. Here’s my first attempt, which demonstrates some functions from the RCurl and XML packages. update: corrected a couple of copy/paste

Read more »

Ed Burnette on Software Patents

August 17, 2010
By

Ed Burnette makes a point that hits home, with regard to software patents, and how engineers and programmers of modern companies are now being asked to write them: Unfortunately, the joke is on all of us. It’s on our economy, as we let patents choke down innovation and increase fear, uncertainty, and doubt in an

Read more »

R Environments for Gibbs Sampler State

August 10, 2010
By
R Environments for Gibbs Sampler State

I recently decided to revisit some R code that implements a Gibbs sampler in an attempt to decrease the iteration time. My strategy was to implement the sampler state as an R environment rather than a list. The rationale was that passing an environment to and from functions would reduce the amount of duplication (memory

Read more »

A tty Connection for R

July 26, 2010
By

I completed (some time ago) an initial version of a patch for R, version 2.11.1, that adds a POSIX tty connection. The patch is confirmed to compile and works on Mac OS X (thanks to Ashwin Bhat of Georgia Tech) and Debian GNU Linux. However, it should be portable to other POSIX compliant operating systems.

Read more »

Documenting R‘s Connections Internals

July 16, 2010
By
Documenting R‘s Connections Internals

In studying R‘s connections source code, I’ve put together a series of notes about their workings. Rather than let the notes go where most of my notes go (I have no idea ), I decided to do some proofreading and make the notes available to others who might be interested. These notes should make the

Read more »

More powerful iconv in R

June 19, 2010
By

The R function iconv converts between character string encodings, for example, from the locale dependent encoding to UTF-8: > iconv("foo", to="UTF-8") [1] "foo" However, R has long-running trouble with embedded null characters ('') in strings. Hence, if we try to convert to an encoding that permits embedded null characters, iconv will fail: > iconv("foo", to="UTF-16")

Read more »

Why R doesn’t suck

June 19, 2010
By

I first encountered the R programming language a few years ago when I needed to make some plots. Although I’ve used it occasionally since, I always considered it a sort of “Perl for statisticians” — a useful swiss-army knife with … Continue reading →

Read more »

R-help follow-up: truncated exponential

June 16, 2010
By
R-help follow-up: truncated exponential

I recently posted the message below with regard to sampling from the truncated exponential distribution. I left out the derivation of the CDF (mostly because text math is ugly), so I’ve included it here. There is also a short JSS article about truncated distributions in R. This problem in particular may likely be found in

Read more »

biomaRt and GenomeGraphs: a worked example

June 6, 2010
By
biomaRt and GenomeGraphs: a worked example

As promised a few posts ago, another demonstration of the excellent biomaRt package, this time in conjunction with GenomeGraphs. Here’s what we’re going to do: Grab some public microarray data Normalise and get a list of the most differentially-expressed probesets Use biomaRt to fetch the genes associated with those probesets Plot the data using GenomeGraphs

Read more »