When I type the following in RStudio it works fine:
nyt1 <- read.csv(url("http://stat.columbia.edu/~rachel/datasets/nyt1.csv"))
But when I type the same thing in the R console, I get this error:
Error in open.connection(file, "rt") : cannot open the connection
In addition: Warning message:
In open.connection(file, "rt") : cannot open: HTTP status was '0 (nil)'
I have checked and rechecked a thousand times and everything seems to be exactly the same between RStudio and R (same versions, etc), so why the error?
There can be differences in proxy settings or other network settings between RStudio and the R Console. As one example, the use of the "internet2" option (defined on the command line when R is invoked) could differ. setInternet2(NA)
on each platform will show the setting. If the result of that differs, that could be the source of the difference.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With