Prompt:
Asking good questions is a valuable skill to have - asking questions in an online setting is both easier and harder than asking questions in person: we can prepare to ask a question but we are also expected to prepare. The links posted here give some advice on how to ask good questions:
stackoverflow’s Asking a good question
minimal complete verifiable example, minimal reproducible example
Follow these links and read through the advice given, then
- Pick at least one question from stackoverflow or the R help and answer it.
Write a blog post answering the following questions:
- Document which question you answered (link to your answer).
- Relate your experience of answering the question to your reading.
The problem I submitted an answer for ended up being a lot easier than what everybody else was thinking. In this case, the author needed to get data from a wide format into a long format. The author provided code for the process, but did not include code for a sample dataset. This did not allow me to fully test to see if my solution worked, but the problem was within the syntax. The author was inputting a list of countries to melt with reshape2 and was missing a couple of commas. The error could be reproduced with c("Var1" "Var2)
. I also provided a recommendation to use the pivot_longer()
function to simplify the amount of typing (and potential typing errors).
Minimal: the code provide was quite basic, but included all columns necessary for their particular problem. However, this was actually needed in this case to solve their problem.
Complete: author did not provide the dataset, so I could not reproduce the problem directly
Reproducible: a similar syntax error gave the same result on my computer, so the problem was reproducible with my suspicion of the problem.
Instructions to follow.