What is a reprex and why is it useful?


Figure 1

The term reprex was coined by Romain François in a 2014 tweet: The origin of the term “reprex”, as a word smash of “reproducible” and “example”.


Figure 2

A tweet from Dr. Sam Tyner-Monroe, describing her experience solving her own problem through the process of making a reprex (December 12, 2019)
A tweet from Dr. Sam Tyner-Monroe, describing her experience solving her own problem through the process of making a reprex (December 12, 2019)

Figure 3

A tweet from Jenny Bryan comparing reprexes to rubber duck debugging (January 4, 2018)
A tweet from Jenny Bryan comparing reprexes to rubber duck debugging (January 4, 2018)

Identify the problem and make a plan


Figure 1


Figure 2


Figure 3


Figure 4


Figure 5


Figure 6


Minimal Reproducible Data


Figure 1

  • Screenshot of the ratdat comple_old dataset.

  • Figure 2


    Figure 3


    Figure 4

    which is even more simplistic than the one before but still contains the elements we are interested in–we have a set of “species” separated into facets and we want to get rid of one of them. In reality, had we realized that we needed to get rid of the rows with “sp.” in them, we could have ignored the figure entirely and posed the question about the data alone. E.g., “how do I remove rows that contain a specific name?” Then give just the example dataset we created.


    Figure 5


    Figure 6

    That’s more like it! You can keep playing around with it or you can give it more thought apriori, but either way you get the idea. While what we get is not an exact replica, it’s an analogy. The important thing is that we created a figure whose basic elements/structure or “key features” remain intact–namely, the number and type of variables and categories.


    Figure 7


    Figure 8


    Figure 9


    Minimal Reproducible CodeXXX FIXME:XXX maybe this story should end with Mishka solving their own problem.with interaction term:


    Asking your question


    Figure 1

    A function called "my_awesome_custom_function" is lurking in my R environment. I must have defined it a while ago and forgotten! Code that includes this function will not run for someone else unless the function definition is also included in the reprex.
    A function called "my_awesome_custom_function" is lurking in my R environment. I must have defined it a while ago and forgotten! Code that includes this function will not run for someone else unless the function definition is also included in the reprex.

    Figure 2


    Figure 3