I am trying to filter values within a variable in a dataset called brazilcorona
.
This dataset contains a variable called data
, which contains the date (year/month/day) that the covid infection ocurred, for example 2020-03-14
(14th march of 2020).
Specifically, I am trying to create a new vector and eliminate all the dates that are previous to 2020-05-15 (15th may of 2020).
In order to to so, I tried the following code
newdata <- filter (Brazilcorona, data > 2020-05-15)
When I try to run the code above, R shows the error not meaningful for factors
In other words, I would like to create a new vector that has only dates after may 15th, that is, occurs after 2020-05-15
.
Could someone help me? Thanks