Reproducing reports in R using Github Code [message #25729] |
Thu, 01 December 2022 11:41 ![Go to next message Go to previous message](/theme/default/images/down.png) |
victor
Messages: 4 Registered: December 2022
|
Member |
|
|
I am trying to reproduce some figures from DHS reports, specifically birth registration data.
Using this code from the github page, I should be able to do just that. https://github.com/DHSProgram/DHS-Indicators-R/blob/main/Cha p02_PH/PH_POP.R
However it seems that this code does not work. Am I doing something wrong?
The first line it already goes wrong
PRdata[["ager"]] <- ifelse(PRdata[["hv103"]]==1 , as.integer(PRdata[["hv105"]]/5), NA)
using double square brackets is quite uncommon, but it should work. However addressing the hv103 and hv105 data like that is just incorrect. This data is spread across multiple columns per respondent, indicated by hv105_01, hv105_02 etc.
Hopefully someone know how to get this running.
|
|
|