@mara suggested using a reprex. Using a reprex not only makes it easier for us to help you it also makes it easy to show what you code produces, including plots.
Here is an example of a reprex that includes a plot:
suppressPackageStartupMessages(library(tidyverse))
suppressPackageStartupMessages(library(ggplot2))
# table some data
tbl <- tribble(
~x, ~y,
1,2,
2,3,
5,7,
3,1,
)
# shows the table content
tbl
#> # A tibble: 4 x 2
#> x y
#> <dbl> <dbl>
#> 1 1. 2.
#> 2 2. 3.
#> 3 5. 7.
#> 4 3. 1.
plt <- ggplot(tbl, aes(x,y)) + geom_line()
# shows the plot
plt

Created on 2018-03-16 by the reprex package (v0.2.0).
And more info about reprex's
A prose description isn't sufficient, you also need to make a simple reprex that:
- Builds the input data you are using.
- The function you are trying to write, even if it doesn't work.
- Usage of the function you are trying to write, even if it doesn't work.
- Builds the output data you want the function to produce.
You can learn more about reprex's here:
Right now the is an issue with the version of reprex that is in CRAN so you should download it directly from github.
Until CRAN catches up with the latest version install reprex with
devtools::install_github("tidyverse/reprex")
The reason we ask for a reprex is that it is the easiest and quickest way for someone to understand the issue you are running into and answer it.
Nearly everyone here who is answering questions is doing it on their own time and really appreciate anything you can do to minimize that time.