Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ribind_labelled () - advice on columns with all NAs #149

Open
skuchukh opened this issue Feb 29, 2024 · 0 comments
Open

ribind_labelled () - advice on columns with all NAs #149

skuchukh opened this issue Feb 29, 2024 · 0 comments

Comments

@skuchukh
Copy link

Hello

I have a few questions on rbind_labelled()function. I saw this #9 though I have not been able to figure out my issues yet.

  1. I'm using both male and female datasets from DHS but of course some variables e.g. ANC testing (v840-v841) are not available in male datasets; or these variables are not available in neither in some old surveys (e.g. BJ2001DHS).

When I try to do
rbind_labelled(ir, mr, labels=list(v840 = "concatenate")), I get an error message that the NA (logical) cannot be concatenated with character. Even when I convert the NAs to integer, and give some random, fake label to these columns via labelled::var_label(ir$v840) <- 'some label', I get an error:Error invalidate_labelled(): ! labelsmust have names. I was wondering if you have any advice?

  1. For concatenated variables, is there a way to maintain a variable name/label? Even though all unique value labels are maintained, the variable/column names seems to disappear.

Thank you so much!!

Salome

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant