HertieDataScience / SyllabusAndLectures

Hertie School of Governance Introduction to Collaborative Social Science Data Analysis
MIT License
37 stars 60 forks source link

Downloading .R file from browser #62

Closed mr-r0b0t closed 8 years ago

mr-r0b0t commented 8 years ago

Hi everyone,

I'm trying to download a .R file from a website (https) with a download button (Harvard Dataverse), but it doesn't download the file directly to my local hard drive. It only displays the file in the browser in a strange way and doesn't show the actual .R file.

I was using the standard R Studio utils package and some other ones (e.g. downloader), but I always get the same error message:

"download had nonzero exit status"

This is the code I was using:

utils::download.file(url = "https://dataverse.harvard.edu/api/access/datafile/2684585", destfile = "~/GitHub/CollaborativeResearchProject/")

Has anyone had a similar problem or can offer a solution?

Thank's a lot!

Best,

Benedikt

mcallaghan commented 8 years ago

The file that comes back, at least for me, is not an R file but an html file letting me know that there was a 500 internal server error. Could be a problem with the link, or a problem on their server.

What's the link to the page you were trying to download from? I might have had similar problems before. Although I never got around it, some solutions could be relevant.

If you can't actually download the r file with pointing and clicking, it may just not be there. You could tell the Harvard dataverse that they have a broken link.

mr-r0b0t commented 8 years ago

Thanks for your quick reply!

This is the website with the .R file I would like to download and have a look:

https://dataverse.harvard.edu/dataset.xhtml?persistentId=doi:10.7910/DVN/BTKZEQ

File: cimi.analysis.R

mcallaghan commented 8 years ago

I still can't get the file. If you select it and press the main download button you go to a 500 error page, and if you click on the download button directly you get to the same 500 page but displayed as plain text. There must be some problem. I'd email them, Johannes Karreth invites you to...

mcallaghan commented 8 years ago

Unless you are getting different results and it's just on my side...

mr-r0b0t commented 8 years ago

Same here... You are right, there must be some problem. I've already been in contact with her and will send her another email. Thank's for your quick help!

mr-r0b0t commented 8 years ago

The authors did reply and they uploaded the correct version on Dataverse. Thank's anyway!

Best,

Benedikt

christophergandrud commented 8 years ago

Perfect