[R] On Reproducible Code

David Winsemius dwinsemius at comcast.net
Thu Jul 26 02:01:05 CEST 2012


On Jul 25, 2012, at 8:50 AM, David L Carlson wrote:

> We often refer requesters to the Posting Guide and chide them for not
> reading it. Recently I had occasion to re-read the Posting Guide  
> which is
> for all R lists not just R-help. The word "reproducible" does not  
> appear
> anywhere in the guide. The closest it comes is the following  
> suggestion:
>
> "Sometimes it helps to provide a small example that someone can  
> actually
> run."
>
> Recommendations to use the function dput() to provide sample data do  
> not
> appear in the guide.

The absence of dput from the PG is a bit surprisong, but an equivalent  
bit of advice does appear:

"When providing examples, it is best to give an R command that  
constructs the data, as in the matrix() expression above. For more  
complicated data structures, dump("x", file=stdout()) will print an  
expression that will recreate the object x. "

--
David.

>
> The bottom of messages to R-help does contain the statement you've  
> all seen,
> but I had assumed it summarized advice found elsewhere since first  
> time
> posters may not see the message until after they have posted.
>
> "PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html and provide commented,  
> minimal,
> self-contained, reproducible code."
>
> The Mailing Lists page describes R-help but refers only to the  
> posting guide
> http://www.r-project.org/mail.html and does not include this advisory
> statement.
>
> The R-help Info Page also refers only to the posting guide
> https://stat.ethz.ch/mailman/listinfo/r-help and does not include this
> advisory statement.
>
> I hesitate to sound too optimistic, but there might be some  
> advantage in
> making the statement more prominent and adding a reproducible  
> example using
> dput().
>
> ----------------------------------------------
> David L Carlson
> Associate Professor of Anthropology
> Texas A&M University
> College Station, TX 77843-4352
>
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.

David Winsemius, MD
Heritage Laboratories
West Hartford, CT



More information about the R-help mailing list