rensa
August 30, 2018, 7:27am
2
Hi there! In order to help you more, we need you to make a Repr oducible Ex ample, or reprex
for short. You can learn more about making one here:
Why reprex?
Getting unstuck is hard. Your first step here is usually to create a reprex, or reproducible example. The goal of a reprex is to package your code, and information about your problem so that others can run it and feel your pain. Then, hopefully, folks can more easily provide a solution.
What's in a Reproducible Example?
Parts of a reproducible example:
background information - Describe what you are trying to do. What have you already done?
complete set up - include any library() calls and data to reproduce your issue.
data for a reprex: Here's a discussion on setting up data for a reprex
make it run - include the minimal code required to reproduce your error on the data…
In particular, to figure out why you're getting different results between R and other software, we need access to the data frame you're working with, datafm
. You might also want to check out this post on prepping your data for a reprex:
@EconomiCurtis split this out of FAQ: What's a reproducible example (`reprex`) and how do I do one? .
Curious if you have anything additional to add specifically on "how to prepare your own data for use in a reprex if you can't, or don't know how to reproduce a problem with a built-in dataset."
I think @jessemaegan 's post is about 80% there. The piece it is missing, if your average stack overflow post is any indication, is an explanation about how to prepare your own data for use in a reprex if you can't, or don't know how to reproduce a problem with a built-in dataset.
Some handy things to know for this situation:
deparse()
The ugly as sin, gold standard:
head(my_data, 2) %>%
depa…