I am trying to create an interpretable and aesthetically pleasing date wise line plot, with date along the x axis and freq along the y axis. I am using the count_date1 data frame which contains a further 82 rows.
The plots I have produced have come out too congested making them uninterpretable and not presentable. When I grouped the dates, "group = date" it removes the line plot altogether from the figure. Does anyone have any suggestions as to how I can create the plot I'm after?
library(tidyverse)
library(lubridate)
count_date1 <- tibble(date = dmy(13042015, 13052015, 13062015, 14042015, 14052015, 14062015, 15042015, 15052015, 15062015),
freq = c(24, 12, 32, 23, 15, 16, 12, 12, 34))
count_date1
#> # A tibble: 9 x 2
#> date freq
#> <date> <dbl>
#> 1 2015-04-13 24
#> 2 2015-05-13 12
#> 3 2015-06-13 32
#> 4 2015-04-14 23
#> 5 2015-05-14 15
#> 6 2015-06-14 16
#> 7 2015-04-15 12
#> 8 2015-05-15 12
#> 9 2015-06-15 34
#this is the code I used
ggplot(count_date1, aes(date, freq)) +
geom_point() +
geom_line(aes(group = date)) +
xlab("Date") +
ylab("No. of Complaints")
#> geom_path: Each group consists of only one observation. Do you need to adjust
#> the group aesthetic?
I am trying to create an interpretable and aesthetically pleasing date wise line plot, with date along the x axis and freq along the y axis. I am using the count_date1 data frame which contains a further 82 rows.
The plots I have produced have come out too congested making them uninterpretable and not presentable. When I grouped the dates, "group = date" it removes the line plot altogether from the figure. Does anyone have any suggestions as to how I can create the plot I'm after?
Created on 2020-08-14 by the reprex package (v0.3.0)
Session info
``` r devtools::session_info() #> ─ Session info ─────────────────────────────────────────────────────────────── #> setting value #> version R version 3.6.3 (2020-02-29) #> os macOS Sierra 10.12.6 #> system x86_64, darwin15.6.0 #> ui X11 #> language (EN) #> collate en_AU.UTF-8 #> ctype en_AU.UTF-8 #> tz Australia/Melbourne #> date 2020-08-14 #> #> ─ Packages ─────────────────────────────────────────────────────────────────── #> package * version date lib source #> assertthat 0.2.1 2019-03-21 [1] CRAN (R 3.6.0) #> backports 1.1.7 2020-05-13 [1] CRAN (R 3.6.2) #> blob 1.2.1 2020-01-20 [1] CRAN (R 3.6.0) #> broom 0.7.0 2020-07-09 [1] CRAN (R 3.6.2) #> callr 3.4.3 2020-03-28 [1] CRAN (R 3.6.2) #> cellranger 1.1.0 2016-07-27 [1] CRAN (R 3.6.0) #> cli 2.0.2 2020-02-28 [1] CRAN (R 3.6.0) #> colorspace 1.4-1 2019-03-18 [1] CRAN (R 3.6.0) #> crayon 1.3.4 2017-09-16 [1] CRAN (R 3.6.0) #> curl 4.3 2019-12-02 [1] CRAN (R 3.6.0) #> DBI 1.1.0 2019-12-15 [1] CRAN (R 3.6.0) #> dbplyr 1.4.4 2020-05-27 [1] CRAN (R 3.6.2) #> desc 1.2.0 2018-05-01 [1] CRAN (R 3.6.0) #> devtools 2.3.1 2020-07-21 [1] CRAN (R 3.6.2) #> digest 0.6.25 2020-02-23 [1] CRAN (R 3.6.0) #> dplyr * 1.0.0 2020-05-29 [1] CRAN (R 3.6.2) #> ellipsis 0.3.1 2020-05-15 [1] CRAN (R 3.6.2) #> evaluate 0.14 2019-05-28 [1] CRAN (R 3.6.0) #> fansi 0.4.1 2020-01-08 [1] CRAN (R 3.6.0) #> farver 2.0.3 2020-01-16 [1] CRAN (R 3.6.0) #> forcats * 0.5.0 2020-03-01 [1] CRAN (R 3.6.0) #> fs 1.4.1 2020-04-04 [1] CRAN (R 3.6.3) #> generics 0.0.2 2018-11-29 [1] CRAN (R 3.6.0) #> ggplot2 * 3.3.1 2020-05-28 [1] CRAN (R 3.6.2) #> glue 1.4.1 2020-05-13 [1] CRAN (R 3.6.2) #> gtable 0.3.0 2019-03-25 [1] CRAN (R 3.6.0) #> haven 2.3.1 2020-06-01 [1] CRAN (R 3.6.2) #> highr 0.8 2019-03-20 [1] CRAN (R 3.6.0) #> hms 0.5.3 2020-01-08 [1] CRAN (R 3.6.0) #> htmltools 0.5.0 2020-06-16 [1] CRAN (R 3.6.2) #> httr 1.4.1 2019-08-05 [1] CRAN (R 3.6.0) #> jsonlite 1.6.1 2020-02-02 [1] CRAN (R 3.6.0) #> knitr 1.29 2020-06-23 [1] CRAN (R 3.6.2) #> labeling 0.3 2014-08-23 [1] CRAN (R 3.6.0) #> lifecycle 0.2.0 2020-03-06 [1] CRAN (R 3.6.0) #> lubridate * 1.7.8 2020-04-06 [1] CRAN (R 3.6.3) #> magrittr 1.5 2014-11-22 [1] CRAN (R 3.6.0) #> memoise 1.1.0 2017-04-21 [1] CRAN (R 3.6.0) #> mime 0.9 2020-02-04 [1] CRAN (R 3.6.0) #> modelr 0.1.8 2020-05-19 [1] CRAN (R 3.6.2) #> munsell 0.5.0 2018-06-12 [1] CRAN (R 3.6.0) #> pillar 1.4.4 2020-05-05 [1] CRAN (R 3.6.2) #> pkgbuild 1.0.8 2020-05-07 [1] CRAN (R 3.6.3) #> pkgconfig 2.0.3 2019-09-22 [1] CRAN (R 3.6.0) #> pkgload 1.1.0 2020-05-29 [1] CRAN (R 3.6.2) #> prettyunits 1.1.1 2020-01-24 [1] CRAN (R 3.6.0) #> processx 3.4.2 2020-02-09 [1] CRAN (R 3.6.0) #> ps 1.3.3 2020-05-08 [1] CRAN (R 3.6.2) #> purrr * 0.3.4 2020-04-17 [1] CRAN (R 3.6.2) #> R6 2.4.1 2019-11-12 [1] CRAN (R 3.6.0) #> Rcpp 1.0.4.6 2020-04-09 [1] CRAN (R 3.6.3) #> readr * 1.3.1 2018-12-21 [1] CRAN (R 3.6.0) #> readxl 1.3.1 2019-03-13 [1] CRAN (R 3.6.0) #> remotes 2.2.0 2020-07-21 [1] CRAN (R 3.6.2) #> reprex 0.3.0 2019-05-16 [1] CRAN (R 3.6.0) #> rlang 0.4.7 2020-07-09 [1] CRAN (R 3.6.2) #> rmarkdown 2.3 2020-06-18 [1] CRAN (R 3.6.2) #> rprojroot 1.3-2 2018-01-03 [1] CRAN (R 3.6.0) #> rvest 0.3.6 2020-07-25 [1] CRAN (R 3.6.2) #> scales 1.1.1 2020-05-11 [1] CRAN (R 3.6.2) #> sessioninfo 1.1.1 2018-11-05 [1] CRAN (R 3.6.0) #> stringi 1.4.6 2020-02-17 [1] CRAN (R 3.6.0) #> stringr * 1.4.0 2019-02-10 [1] CRAN (R 3.6.0) #> testthat 2.3.2 2020-03-02 [1] CRAN (R 3.6.0) #> tibble * 3.0.1 2020-04-20 [1] CRAN (R 3.6.2) #> tidyr * 1.1.0 2020-05-20 [1] CRAN (R 3.6.3) #> tidyselect 1.1.0 2020-05-11 [1] CRAN (R 3.6.2) #> tidyverse * 1.3.0 2019-11-21 [1] CRAN (R 3.6.0) #> usethis 1.6.1 2020-04-29 [1] CRAN (R 3.6.2) #> utf8 1.1.4 2018-05-24 [1] CRAN (R 3.6.0) #> vctrs 0.3.2 2020-07-15 [1] CRAN (R 3.6.2) #> withr 2.2.0 2020-04-20 [1] CRAN (R 3.6.2) #> xfun 0.16 2020-07-24 [1] CRAN (R 3.6.2) #> xml2 1.3.2 2020-04-23 [1] CRAN (R 3.6.2) #> yaml 2.2.1 2020-02-01 [1] CRAN (R 3.6.0) #> #> [1] /Library/Frameworks/R.framework/Versions/3.6/Resources/library ```