Opening databases in RStudio [message #11747] |
Mon, 06 February 2017 11:59 |
dasanchezp
Messages: 11 Registered: February 2017 Location: San Sebastian
|
Member |
|
|
Dear DHS Program User Forum,
I downloaded many databases, but I realized RStudio does not get all the information (variables). Or maybe I am doing something wrong. I am reading the DHS Survey Manual and the Model Woman's Questionnaire and I found sections: 2 (Reproduction), 3 (Contraception), 4 (Pregnancy), 7 (Marriage and Sexual Activity) and 8 (Fertility Preferences), being these the sections of my interest. These sections should be in the women databases but I cannot find them.
For example, I downloaded Albania's database. Then, I opened ALIR50FL.SAV using R. In this file, I only have variables from V000 to V191, ML101 and from BIDX.01 to BIDX.05. Nothing else. I followed this code:
library(foreign)
df=read.spss("ALIR50FL.SAV", to.data.frame = TRUE)
Indeed, I mainly need the sections described above.
May you help me, please?
Thanks in advance.
Best regards,
David A. Sanchez P.
|
|
|
|
|
Re: Opening databases in RStudio [message #11807 is a reply to message #11806] |
Fri, 10 February 2017 16:34 |
Trevor-DHS
Messages: 803 Registered: January 2013
|
Senior Member |
|
|
If you are using View() to see the data, I've no idea how to increase the view. I'm not sure you can
You can try the following to see all of the variable names:
options(max.print=5000)
names(df)
Also to see the variable labels you can use:
attr(df, "variable.labels")
Will show you all of the value labels
[Updated on: Fri, 10 February 2017 16:34] Report message to a moderator
|
|
|
|
|