Closed jeanetteclark closed 6 years ago
I asked Toby what his solution was to this bug, and he says he wrapped the url in the url
function before passing to read.csv
. Will do some testing today.
okay - this appears to actually be an issue with windows, when you try to knit a markdown. The above solution did not work but this one does:
library(RCurl)
data <- getURL("https://knb.ecoinformatics.org/knb/d1/mn/v2/object/knb.92379.1",
ssl.verifypeer=0L, followlocation=1L)
read.csv(text=data)
@cornejotux I think you will still be able to go through the training on windows as-is, but you won't be able to knit
@jkibele can you add RCurl
to the list of required packages?
Hey @jeanetteclark I'm curious if there might be an easier workaround that doesn't involve another package. Does this work for you?
download.file("https://knb.ecoinformatics.org/knb/d1/mn/v2/object/knb.92379.1",
"out.csv",
method = "libcurl")
Hm, I'll test that but it is a different workflow - saving the file locally and then reading from the file, as opposed to reading from the URL
How about just
read.csv(url("https://knb.ecoinformatics.org/knb/d1/mn/v2/object/knb.92379.1",
method = "libcurl"))
then?
ah! that works! Thanks @amoeba
nevermind on the RCurl package @jkibele
If you find any Windows users that can't make this method work, check that their R version is recent. I think this situation might've improved with R 3.4.0.
hah! @amoeba, after looking through the commit history I just saw that you actually fixed this after the training. you're about 20 steps ahead of the rest of us
https://github.com/NCEAS/sasap-training/commit/114b562d3813a98ec471c895b4d5f4e7f4abc7ae
And twice as forgetful as anyone! And look at that rockin' commit message. Nice spelunking.
Figure out what the windows download bug was and how to fix it
interactions between windows - R - curl?