I have read the How to make a great R reproducible example famous thread, but there is no specific advice regarding how to ask a great ggplot
, lat
First, follow the agreed-upon standards to ask a great R question and make a great R reproducible example (see this discussion):
c
, df
or data
.mtcars
or iris
. Don't share links to files, most of us don't like downloading files from unknown parties.For graph/plot/map-generating code, please:
library
or require
used to load packages with which you produced the plots/graphs/maps.Strip out all the cosmetic parts of the code, unless the problem you want to address has to do specifically with such cosmetics. Excessive and unnecessary code clutters the question, making it more difficult to understand and address.
theme
calls to format backgrounds, colors, axes and the like.labs
calls and any similarly used to set titles, subtitles and the like.Check if your data is tidy. If you have to make repetitive calls to produce each line in your plot, it's likely your data isn't tidy.
ggplot2
or lattice
-based solution, or whether a solution from any package is acceptable.Regarding your expected output, state it in words whenever possible. If an image is needed, please include one with at least these characteristics: