What is a reprex and why is it useful?
Figure 1
The term reprex was coined by Romain François in a
2014 tweet:
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)](../fig/samtynermonroe.png)
Figure 3
![A tweet from Jenny Bryan comparing reprexes to rubber duck debugging (January 4, 2018)](../fig/jennybryan.png)
Identify the problem and make a plan
Figure 1
![](../fig/2-identify-the-problem-rendered-unnamed-chunk-4-1.png)
Figure 2
![](../fig/2-identify-the-problem-rendered-unnamed-chunk-9-1.png)
Figure 3
![](../fig/2-identify-the-problem-rendered-unnamed-chunk-11-1.png)
Figure 4
![](../fig/2-identify-the-problem-rendered-unnamed-chunk-15-1.png)
Figure 5
![](../fig/2-identify-the-problem-rendered-unnamed-chunk-16-1.png)
Figure 6
![](../fig/2-identify-the-problem-rendered-unnamed-chunk-17-1.png)
Minimal Reproducible Data
Figure 1
![Screenshot of the ratdat comple_old dataset.](../fig/data_screenshot.png)
Figure 2
![](../fig/3-minimal-reproducible-data-rendered-unnamed-chunk-9-1.png)
Figure 3
![](../fig/3-minimal-reproducible-data-rendered-unnamed-chunk-15-1.png)
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
![](../fig/3-minimal-reproducible-data-rendered-unnamed-chunk-22-1.png)
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
![](../fig/3-minimal-reproducible-data-rendered-unnamed-chunk-24-1.png)
Figure 8
![](../fig/3-minimal-reproducible-data-rendered-unnamed-chunk-25-1.png)
Figure 9
![](../fig/3-minimal-reproducible-data-rendered-unnamed-chunk-25-2.png)
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.](../fig/custom_function.png)
"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
![](https://i.imgur.com/bOA0BAS.png)
Figure 3
![](https://i.imgur.com/kHBf9Zr.png)