Data Analyst in R Covid 19 Guided Project Help

positive_tested_top_3 <- covid_top_10 %>% mutate(infected = positive_cases/tested_cases, ratio = infected >0.08)
Below is one of my previous attempts that got close to the end result.
positive_tested_top_3 <- covid_top_10 %>% sort(decreasing = TRUE) %>% head(3)

What I expected to happen:
To do part 6 properly. To get the countries with the highest number of positive cases against number of tests. To create a new vector that only has the top three countries with the new column.

What actually happened:
The new column presents the result as True or False but not the numeric value.

Hi @jadeve.jimenez,

Taking a stab here. Not too familiar with R. Could it be that your format is off? Should your dataframe infected be followed by a comma and then the new variable, ratio

i.e.
infected <- positive_cases/tested_cases
mutate(infected, ratio = infected >0.08)

image

1 Like