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
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 %
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
I have cobbled together a short script to plot Covid-19 data.
setwd("~/Apps/Models/1-CoronaVirus")
library(tidyverse)
library(lubridate)
datO <- read.csv("https://api.covidtracking.com/v1/states/oh/daily.csv";)
datO[ ,1] <- ymd(datO[ ,1])
dfO <- tibble::as_tibble(data.frame(datO[ ,"date"],datO
4 matches
Mail list logo