Back

Explore Courses Blog Tutorials Interview Questions
+1 vote
4 views
in R Programming by (160 points)

Can someone please tell me some tips to make a great minimal reproducible  example? And How can I paste data structures from  in a text format, What other information should I include?

1 Answer

0 votes
by (46k points)
edited by

Minimal reproducible example consists of the following items:

  1. A minimal dataset which is necessary to reproduce the error.

  2. The minimal runnable code necessary to reproduce the error, which can be run on the given dataset.

  3. If there’s random processes, a seed (set by set.seed()) for reproducibility  

  4. The necessary information on the used packages, R version and system it’s run on.

You can also look for the examples in the help files of the used function it’s often helpful. Therefore in general all the codes given can fulfill the requirements of a minimal reproducible example: minimal code is provided, data is provided and everything in runnable.

To quickly create a dput of your data just copy the data (only a line or two) to clipboard and run the following command in R:

For Excel:

dput(read.table("clipboard",sep="\t",header=TRUE))

For txt file:

dput(read.table("clipboard",sep="",header=TRUE))

If your data is in the clipboard of course then you can also change the sep.

Related questions

0 votes
1 answer
+1 vote
1 answer
asked May 29, 2019 in R Programming by Nigam (4k points)
+1 vote
1 answer
+1 vote
1 answer

Browse Categories

...