Re: [R] Ggplot2 Line Problem

2020-08-17 Thread Stephen P. Molnar
Many thanks. That solved the problem. On 08/17/2020 01:49 AM, Rui Barradas wrote: Hello, This type of problem is almost always a data reshaping problem. ggplot graphics work better if the data is in the long format and you have 3 columns for counts, one column for each category. If you reform

Re: [R] Ggplot2 Line Problem

2020-08-16 Thread Rui Barradas
Hello, Sorry, I forgot you also want the line type changed. Remove color and linetype from the initial call to ggplot and include aes(color = cases, linetype = cases) in geom_line. Then add a layer scale_linetype_manual with the same name and labels to merge it with the color legend. dfO %

Re: [R] Ggplot2 Line Problem

2020-08-16 Thread Rui Barradas
Hello, This type of problem is almost always a data reshaping problem. ggplot graphics work better if the data is in the long format and you have 3 columns for counts, one column for each category. If you reformat from the current wide format to the long format you will have a date vector, a c