decoderleco / deces_europe

programme R pour créer des analyses des décèes en Europe
28 stars 10 forks source link

Warning when creating deces_age #8

Closed JeanGarf closed 3 years ago

JeanGarf commented 3 years ago

ISSUE Warning when creating deces_age

deces_age <- deces_annuel_age %>% mutate(age = as.double(str_sub(age,2,length(age)))) %>% filter(age !="_LT1") %>% filter(age !="_OPEN")

ANALYSIS age is converted to double, but some lines contains alphanumeric strings like Y_LT1

FIX Remove first, lines containing alphanumeric strings like Y_LT1 then convert

deces_age <- deces_annuel_age %>% filter(age !="Y_LT1") %>% filter(age !="Y_OPEN") %>% mutate(age = as.double(str_sub(age,2,length(age))))

decoderleco commented 3 years ago

Yes there is a warning but it works fine. Y_LT1 is necessary, it contains numeber of deaths that are 0 year old.