|
|
Re: Issue with importing Individual Recode datasets for India for the years 2015-2016 on R [message #24377 is a reply to message #24374] |
Tue, 03 May 2022 17:34 |
Navya
Messages: 8 Registered: May 2022
|
Member |
|
|
Hi,
Thank you for your quick reply. I am sure I need to do the merge since although both CR and IR contain the domestic violence variables, I need the data for currently unmarried women from the IR file, who make up around 30% of the total women's sample in the 2005-2006 survey. Therefore, using IR as the base file rather than CR is necessary to ensure I don't lose important data.
I merged the datasets for 2005-2006 by v001, v002, v003 and v024 (which took into account the primary sampling unit, household number, respondent's/ individual's line number and state).
The issue only arises for the BR, HR and IR files for the years 2015-2016 (I only need the IR file), and gives the same error when I try to import the dataset as a .dta file rather than a .dat file. I was wondering if there's any way I can import the IR file to R using another method?
Thank you for your help!
|
|
|
|
Re: Issue with importing Individual Recode datasets for India for the years 2015-2016 on R [message #25178 is a reply to message #24385] |
Fri, 09 September 2022 13:15 |
Nidigot
Messages: 7 Registered: July 2022
|
Member |
|
|
This would be the ugliest work around, but download the file from DHS and then store it in RDHS' cache:
data <- read_dta('/Users/Nidi/Desktop/filename.DTA')
saveRDS(data, "~/Library/Caches/rdhs/datasets/filename.rds")
and then call the file from there.
If you necessarily would like to have it in the "downloads list" then store it (depending on where it should have been, but here I choose "1":
downloads[[1]] <- "~/Library/Caches/rdhs/datasets/filename.rds"
like I said: it is ugly, but it does work for your purpose
|
|
|