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

Hmisc::mdb.get not available on Windows #9

Open
mikesmith2468 opened this issue Aug 27, 2019 · 10 comments
Open

Hmisc::mdb.get not available on Windows #9

mikesmith2468 opened this issue Aug 27, 2019 · 10 comments

Comments

@mikesmith2468
Copy link

With the absence of the Hmisc::mdb.get function on Windows, it appears the only supported way to connect to Access databases on Windows is via ODBC. I've managed to get this working via RODBC (without needing to create the DSNs via the Windows administrative tools) but transferring the data from the Access file into R is unworkably slow for the larger tables. I got bored of waiting after 24 hours for one of them, on a reasonably capable machine. It also has significant implementation challenges depending on the "bit-ness" of both the R install and the Access install.

Instead I have a helper function that I'm testing that uses getIPEDSSurvey() to pull down all the zipped CSVs from NCES for a given year, extracts them and imports them into R individually, and then saves them all as an Rds file. My hope is that this could take the place of the download_ipeds() function on Windows machines only: as far as I have been able to tell, the resulting Rds file looks identical to the one that comes from Hmisc::mdb.get, and so your existing functions for working with the data in the Rds should not need to be changed. However, it does rely on the continued existence of the getIPEDSSurvey() function.

Thoughts?

-m.

@jbryer
Copy link
Owner

jbryer commented Aug 27, 2019 via email

@mikesmith2468
Copy link
Author

Indeed. It's also a little ironic that getting to the data is straightforward on non-MS platforms but next to impossible on Windows... Anyway, I'll keep testing and I should have something for you in the next few days.

@jbryer
Copy link
Owner

jbryer commented Aug 27, 2019 via email

@mikesmith2468
Copy link
Author

Yeah, that one is down to the trailing '/' in the exdir parameter to unzip(); for some reason you have to remove that on Windows, whereas other platforms don't care whether it's there or not. I think it's a known issue.

For your package, I think it's not a problem -- it only shows up when trying to unzip the Access file, and that's not going to lead to anything usable on Windows anyway. My workaround uses getIPEDSSurvey, which doesn't suffer from the same issue. So I think we can probably fix both the Windows issues at once.

@tyleransom
Copy link

@mikesmith2468 Do you happen to have a gist (or fork) that shows this functionality? I am a Windows user experiencing all of these known issues.

@jbryer
Copy link
Owner

jbryer commented Nov 8, 2019

I pushed an update to Github that may fix this. Can you verify @tyleransom

Also, I tried to find an alternative way to use the MS Access files (the new way IPEDS provides data) on Windows. I have a few lines of code at the bottom of this file: https://github.com/jbryer/ipeds/blob/master/ipeds.dev.R
The bad news is I cannot get this to work. I suspect it has to do with the file bing 32 bit and I was trying to run this on 64 bit Windows. If someone can figure this out, let me know as I don't have time nor desire to figure out a weird Windows issue.

@tyleransom
Copy link

Thanks, @jbryer I will give it a shot and see if I can figure it out.

@mikesmith2468
Copy link
Author

I made it work (by spawning a 32-bit R instance and connecting through there) but it's too slow to be usable.

@jbryer
Copy link
Owner

jbryer commented Nov 9, 2019 via email

@mikesmith2468
Copy link
Author

I was on 64-bit, yes.

Here's the code I was experimenting with -- I think I found it on Stack Overflow or somewhere like that. It seems to work after a fashion, but I found it unworkably slow as I said earlier. Could be something weird in my setup, though.
access_query_32.zip

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

3 participants