DS4PS / cpp-526-spr-2021

Course shell for Foundations of Data Science I
https://ds4ps.org/cpp-526-spr-2021/
MIT License
1 stars 2 forks source link

New dataset not working #19

Open sandralili opened 3 years ago

sandralili commented 3 years ago

Hello again,

I have tried to eliminate some rows in the "continent" column that contained "NA" values. I have used different methods, and apparently, the functions I am using are working however it looks like other commands go back to the original dataset.

image

new.table <- covid_data[-c(67736:71279), ] # I tried this one and it worked new.table.2 <- covid_data [c(1:67735), ] # This one also worked (I will be using this one on my example)

new.table.2 %>% group_by (date, continent) %>% summarise (cases.per.date = mean (new_cases), .groups = 'drop') %>%

It looks like these functions are not reading the new dataset, and I am not getting an accurate graphic.

Could you please guide me if I am doing anything wrong?

Thanks again!

image

lecy commented 3 years ago

You can filer NAs as follows:

d <- filter( d, ! is.na( continent ) )

Not sure if that helps.

jamisoncrawford commented 3 years ago

It's difficult to diagnose the issue without a reproducible example.

I think @lecy has a great solution - just filter all the NA values. This would focus your graphic on all the other continents (ggplot2 will automatically zoom in on the proper coordinates once we get the noisy NA values out of there).

Let us know what ends up happening.

sandralili commented 3 years ago

Professor @lecy and Professor @jamisoncrawford It worked! thanks so much!!!