timriffe / TR1

Read Human Mortality Database and Human Fertility Database Data from the Web
10 stars 3 forks source link

problem readHMDweb (item="Population") #9

Closed AnastasiosB closed 5 years ago

AnastasiosB commented 5 years ago

Dear Tim,

I tried to download the 1x1 Population size from HMD, using

pop=readHMDweb("USA",username=user,item="Population", password=pass)%>%tbl_df() Instead of six columns (Year, Age, OpenInterval, Female, Male, Total) in the data frame I had nine.

image1

Apparently, the extra columns include the population size in 1934.

image2

The same problem until 2016, where you have the data for 2016 and 2017.

image3

Best, Anastasios

timriffe commented 5 years ago

Hi Anastasios,

This feature can be toggled with the argument fixup=FALSE if you don't want it. But it may be prefereable for you to use the fixup=TRUE version: *1 is the Jan 1 population count, whereas *2 is the Dec 31 population count. This way years can be stored as integer. This is how population counts are used when calculating HMD exposures, for example, so it is in many instances preferable. The default HMD way of storing this information is for many less user friendly, see FAQ2 and FAQ4. So, in year transitions that include universe adjustments (territorial changes), Year is stored as character, with "+" and "-" suffixes. Best, Tim

AnastasiosB commented 5 years ago

Hi Tim,

thank you very much for your detailed explanation

Best, Anastasios