Publications by Matt Shotwell

Plans for a Real tty Connection

02.06.2010

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 termios.h). The connection provided in the ne...

1252 sym

static symbols too?

05.06.2010

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

753 sym R (498 sym/3 pcs)

R-help follow-up: truncated exponential

16.06.2010

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 an introductory text o...

1431 sym R (108 sym/2 pcs) 10 img

Mary, Chloe, and Miriam at breakfast

16.06.2010

Related To leave a comment for the author, please follow the link and comment on their blog: BioStatMatt. R-bloggers.com offers daily e-mail updates about R news and tutorials about learning R and many other topics. Click here if you're looking to post or find an R/data-science job. Want to share your content on R-bloggers? click here if you...

394 sym 2 img

More powerful iconv in R

19.06.2010

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 ('\0') in strings. Hence, if we try to convert to an encoding that permits embedded null characters, iconv will fail: > i...

2463 sym R (2740 sym/4 pcs)

ASCII Scatterplots in R

25.06.2010

I really like R‘s stem function, it creates a stem-and-leaf plot right in the R console, no fancy graphics devices required! In a recent R-help post, Ralf Bierig presented a very nice ASCII scatterplot representing two densities. Unfortunately, I don’t know of any R function that will generate this type of plot, but I will argue that they are...

1362 sym R (2987 sym/2 pcs) 2 img

Funny Math in Governor Approval Ratings

09.07.2010

Andrew Gelman wrote today about some erroneous U.S. Governor approval ratings, noting that the ratings for Janet Napolitano sum to 108%. In fact most of these ratings do not sum to 100%. I prepared a clean CSV file of the ratings, making use of R‘s XML library and the readHTMLTable function. The ratings data file is here approval.csv. > approva...

1313 sym R (201 sym/1 pcs)

Short Open Source Q&A with Revolution Analytics

14.07.2010

I recently e-mailed David Smith of Revolution Analytics with a few questions about their relationship with the R-project, and how they handle R‘s source code. David mentioned, and I’m flattered that my email motivated an additional page on the Revolution website. Beyond this, I have no other relationship with the company. I’d like to thank ...

3562 sym

Documenting R‘s Connections Internals

16.07.2010

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 task of extending or maintaining the connect...

1147 sym 2 img

A tty Connection for R

26.07.2010

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. The tty patch allows for a variety of in...

1739 sym R (388 sym/1 pcs)