programming

Higher Order Functions in R

September 23, 2010 | John Myles White

Introduction Because R is, in part, a functional programming language, the ‘base’ package contains several higher order functions. By higher order functions, I mean functions that take another function as an argument and then do something with that function. If you want to know more about the usefulness of writing ... [Read more...]

Namespaces and name conflicts

August 31, 2010 | Michal

R packages ‘igraph’ and ‘network’ are good examples of two R packages providing similar but complementary functionalities for which there are a lot of name conflicts. As for now the ‘igraph’ package has a namespace while the ‘network’ package (version 1.4-1) does not. This became an issue when I was ... [Read more...]

From igraph to network and back again

August 25, 2010 | Michal

In an effort to achieve this (last paragraph), I created a couple of functions to coerce networks as ‘igraph’ objects to networks as ‘network’ objects and vice versa. I wrapped them into a package called ‘intergraph’ which I just uploaded to my personal miniCRAN. Please mind, this is still an ... [Read more...]

Tools for Hacking R: Git + Subversion

August 24, 2010 | Matt Shotwell

In an earlier post, I discussed how to use Subversion to download, edit, and generate a patch against R‘s source code. Since most of us can’t commit our code changes back to R‘s repository, we can consider alternatives to store and maintain our patch, until it is ... [Read more...]

Tools for Hacking R: Subversion

August 23, 2010 | Matt Shotwell

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 ... [Read more...]

Abstract word clouds using R

August 23, 2010 | nsaunders

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. ... [Read more...]

Ed Burnette on Software Patents

August 17, 2010 | Matt Shotwell

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 ... [Read more...]

R Environments for Gibbs Sampler State

August 10, 2010 | Matt Shotwell

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 ... [Read more...]

A tty Connection for R

July 26, 2010 | Matt Shotwell

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 ... [Read more...]

Documenting R‘s Connections Internals

July 16, 2010 | Matt Shotwell

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 ... [Read more...]

More powerful iconv in R

June 19, 2010 | Matt Shotwell

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 ... [Read more...]

Why R doesn’t suck

June 19, 2010 | Paul Butler

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 | Matt Shotwell

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 ... [Read more...]

biomaRt and GenomeGraphs: a worked example

June 6, 2010 | nsaunders

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 ... [Read more...]

static symbols too?

June 5, 2010 | Matt Shotwell

Continuing in the context of this previous post… 1. Select a static symbol from the R sources, like Connections $ grep "static Rconnection Connections" src/main/connections.c static Rconnection Connections[NCONNECTIONS]; 2. Get its address $ objdump -t `R RHOME`/bin/exec/R | awk '/ Connections/ {print $1}' 000000000093b700 3. Use the symbol __ library(... [Read more...]

Plans for a Real tty Connection

June 2, 2010 | Matt Shotwell

I reverted the name of the tty connection that I described previously, to “serial” connection and updated the patch to R 2.11.1. This name is more appropriate to its function and also makes way for another patch I am working on which implements the full POSIX terminal interface (essentially all of ... [Read more...]

Access attribute_hidden Functions in R Packages

June 1, 2010 | Matt Shotwell

Maybe the title should have been prepended with “Don’t…” The source code of R is littered with “attribute_hidden” declarations. These declarations attempt to ensure that the variable or function may only be accessed by code in the core R distribution, and not by R extension packages. Generally there ... [Read more...]

Must Have Software

May 28, 2010 | John Mount

Having worked with Unix (BSD, HPUX, IRIX, Linux and OSX), Windows (NT4, 2000, XP, Vista and 7) for quite a while I have seen a lot of different software tools. I would like to quickly exhibit my “must have” list. These are the packages that I find to be the single “must ... [Read more...]

robot (SPX) DNA Management Techniques

May 18, 2010 | Milk Trader

Yes, this is related to trading, but no, it is not my thesis on why the Euro is going to parity. Instead, it is sort of a workshop for robot(SPX) developers on how to organize their digital DNA. As you begin to use programming as a money extraction tool ...
[Read more...]

Collect and Parse GPS (NMEA0183) Data in R

May 11, 2010 | Matt Shotwell

I recently wrote a serial connection for R-2.11.0 so that I can communicate with serial devices, for example an old Garmin eTrex Legend. This GPS device is able to output NMEA0183 sentences to a standard serial port (4800,8,1,N). I hooked up the device and used the serial connection to collect ... [Read more...]
1 5 6 7 8 9

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)