Skip to content

Add use of dput() to the instructions at bottom of post?

3 messages · John Kane, Ivan Calandra, David Winsemius

#
It's often difficult to figure out what a problem data set looks like when someone pastes a mess of output from R into an e-mail.  The dput command, used judiciously?I would hope no one would send a 1 M data set?can make life much easier.

I wonder if it would be useful to add a hint in the instructions at the bottom of the posting page, where the list asks for self-contained reproducible code, to also hint at using dput() to supply sample data?

I suspect a considerable number of relatively new users do not know that it exists--certainly that was true for me for quite a long time.
#
I actually thought it was in the posting guide, but I could not find it 
with a text search. Did I overlook it?

I'm not sure that adding the dput() function at the bottom of every 
e-mail will help, since you don't see it when you write an e-mail, just 
when you receive one. Though it cannot hurt to add it.

Ivan

Le 6/27/2011 15:00, John Kane a ?crit :

  
    
#
On Jun 27, 2011, at 9:44 AM, Ivan Calandra wrote:

            
The Posting Guide has an equivalent method it suggests. It has the  
trivial advantantage of being truly cut-and-pastable but the  
disadvantage (relative to dput) that it requires the object to be  
quoted and the file argument to be specified.

 > dump("param", file="")
param <-
structure(list(pi = c(0.5552, 0.2739, 0.1709), mu = c(-0.4868,
8.3846, 12.5317), sigma = c(2.044, 1.399, 1.036)), .Names = c("pi",
"mu", "sigma"), class = "data.frame", row.names = c("1", "2",
"3"))