As far as I know that no country has had more recovered than the cases that occurred. This is being proved with the following code:
library(dplyr)
df %>%
mutate(day=as.Date(day)) %>%
group_by(countryName) %>%
filter(confirmed<recovered) %>%
top_n(1, wt=day)
# A tibble: 0 x 9
Now let us assume that tomorrow, all cases in the country has recovered and no new cases occurred, then:
tomorrow <- read.table(text="
day countryCode countryName region lat lon confirmed recovered death
21379 2020/05/09 US United States Americas 38 -97 1187233 1187234 68566", header=TRUE)
Now I am adding this row to the data frame and execute the code:
df2 <- rbind(df, tomorrow)
df2 %>%
mutate(day=as.Date(day)) %>%
group_by(countryName) %>%
filter(confirmed<recovered) %>%
top_n(1, wt=day)
# A tibble: 1 x 9
# Groups: countryName [1]
# day countryCode countryName region lat lon confirmed recovered death
# <date> <chr> <chr> <chr> <dbl> <dbl> <int> <int> <int>
# 1 2020-05-09 US United States Americas 38 -97 1187233 1187234 68566
If you are looking for R certification, then do check out the R programming certification.