Hi,
I recently started studying R/R studio.
I downloaded a set of data of COVID from github and I tried to plot with ggplot2,
however there might be some problems to complete.
> covid <- read.csv("https://raw.githubusercontent.com/CSSEGISandData/COVID-19/master/csse_covid_19_data/csse_covid_19_time_series/time_series_covid19_confirmed_global.csv",header=T)
> major <- covid[c(51,117,121,138,140,144,197,202,224,226),-c(1,3,4)]
First of all, I selected some countries from all data set,
Next, since the first colume was date, for ggplot, I set a new variable 'date'
date <- seq(as.Date("2020-01-23"),as.Date("2020-05-23"),"day")
Then, I tried
ggplot(major,aes(x=date, y=Country.Region=='China'))
but the program returned the message of 'Error: Aesthetics must be either length 1 or the same as the data (10): x'
Basically, what I wanted to show was just like the graph below:
(Not a graph just shows 'China' but including other countries, also)
I'll be appriciated with your kind help in advance.