timriffe / DDSQLtools

DemoData SQL tools. Wrappers for the DemoTools package to work with UNPD SQL data format
https://timriffe.github.io/DDSQLtools
Other
5 stars 1 forks source link

suggest wrapper for `LTabr()` #8

Closed timriffe closed 5 years ago

timriffe commented 6 years ago

LTabr() is a knarly and excessively complicated function in DemoTools, will need a wrapper for it at some point. Guessing that when this happens I'll be seeing lots of issues on the DemoTools side of development.

mpascariu commented 6 years ago

So, how do we wrap a life table? How should the output look like?

So far we have embedded the DemoTools results in the DataValue column of a UN table (other column were affected as well but mainly DataValue). The output returned from LTabr is a wide data.frame, and obviously it doesn't fit in DataValue column.

Do we convert it to a long data.frame and add all the indicators in a single column? In this case nrow(output_wrap_function) == ncol(output_LTabr) * nrow(input_wrap_function).

How is UN reading the life tables from their system?

timriffe commented 6 years ago

I think we'll need to get an answer from Patrick on this one

timriffe commented 6 years ago

answer: stacked, with each lifetable column in DataValue. We can get an example of HMD data being stored in DemoData to see how metadata columns should look.

mpascariu commented 6 years ago

I am trying to extract data from DemoData. The portal does not seem to work, it is unresponsive. I would like to get life tables or a central death rates, say for Egypt 1976 male and female populations.

timriffe commented 6 years ago

Sypposedly waiting for email from programmer, but I have his email, will ask how it’s looking. Thanks

On Tue, Sep 4, 2018 at 10:09 PM Marius D. Pascariu notifications@github.com wrote:

I am trying to extract data from DemoData. The portal does not seem to work, it is unresponsive. I would like to get life tables or a central death rates, say for Egypt 1976 male and female populations.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/timriffe/DDSQLtools/issues/8#issuecomment-418501281, or mute the thread https://github.com/notifications/unsubscribe-auth/AA3Nm6VfQl8vjHNRHggV6TUOmDum6L-Fks5uXt3mgaJpZM4V8Fdk .

mpascariu commented 6 years ago

Do you have news from Dennis? Because I don't.

timriffe commented 6 years ago

nope!

On Thu, Sep 13, 2018 at 8:45 AM, Marius D. Pascariu < notifications@github.com> wrote:

Do you have news from Dennis? Because I don't.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/timriffe/DDSQLtools/issues/8#issuecomment-420901384, or mute the thread https://github.com/notifications/unsubscribe-auth/AA3NmxbTw0xU9HfgpTFIUpVtdDig5_n0ks5uaf73gaJpZM4V8Fdk .


This mail has been sent through the MPI for Demographic Research. Should you receive a mail that is apparently from a MPI user without this text displayed, then the address has most likely been faked. If you are uncertain about the validity of this message, please check the mail header or ask your system administrator for assistance.

mpascariu commented 5 years ago

Hi @timriffe , I am in the mood to solve and close this issue. For this I tried to check again the UN api and extract death rates data, for Egypt this time. However, the server does not seem to work at all now (maybe I will check again from home network).

A while ago you mentioned that you might have some UN format life tables or death rates. Could you please share that data with me? If I have data I can solve this task and #9 and #7 relatively fast.

Thanks.

timriffe commented 5 years ago

@mpascariu data sent in email

mpascariu commented 5 years ago

The wrapper was added in the package and works just fine given the available data. For now only in mpascariu branch.

I consider this task solved. We can open new issues/todo's when the "real" data will be available.