Is RCurl currently broken on Windows? (error:1407742E:SSL) - r

Good day one and all.
I have been using RCurl to load https://raw. tables from our GitHub repository for data cleanup and analysis. Recently (maybe two weeks) every script using:
read.csv(text = getURL())
stopped working, throwing an error as such:
Error in function (type, msg, asError = TRUE) : error:1407742E:SSL routines:SSL23_GET_SERVER_HELLO:tlsv1 alert protocol version
Unfortunately my understanding of SSL and related issues is very limited (I still git using login credentials in bash).
The thing is, on my Debian machine at work, the code executes flawlessly. And upon removing geURL() and sticking to simple read.csv(), even the Windows code works.
Which is fine but I have functions dependent on url.exists() which also get broken and I have been unable to find a replacement for that.
version
_
platform x86_64-w64-mingw32
arch x86_64
os mingw32
system x86_64, mingw32
status
major 4
minor 0.3
year 2020
month 10
day 10
svn rev 79318
language R
version.string R version 4.0.3 (2020-10-10)
nickname Bunny-Wunnies Freak Out
Thank you in advance for anything that might get me closer to a solution.

The problem is, that the RCurl package for Windows is linked to a very old version of curl (7.40). For reasons I do not know, even the most current packages of RCurl still link to that old version.
In order to use a recent version of curl, you have to install RCurl from the source by using https://cran.r-project.org/bin/windows/Rtools/ .
For compiling RCurl you need to install curl with the relevant header files using "Rtools bash" by the following commands:
pacman -Sy
pacman -S mingw-w64-{i686,x86_64}-curl
After that, you can install RCurl from the source:
install.packages("RCurl", type="source)

Related

Upgrade R version from 3.4.4 to 3.5.3 on Ubuntu 16.04

When we ssh onto this Linux server, it says Welcome to Ubuntu 16.04.7 LTS (GNU/Linux 4.4.0-193-generic x86_64), so this is the type of server we are on.
When we run R to launch R in the server from terminal, and then version, we get:
What is the easiest way to upgrade from version 3.4.4 to version 3.5.3? We don't want to upgrade to v4 or to the latest version quite yet until we ensure no breaking issues with our codebase on R v4, however we would like to make this upgrade to 3.5.3 so we can run an R library that requires 3.5.3+.
How can we do this from the command line on the server here, and after switching from 3.4.4 to 3.5.3 do we then need to re-install all R libraries on the server as well? I'm worried if I start running stuff from the command line and I mess up that I'll break our current R app.
I would be surprised if there is a .deb available for this OS release/R release combination.
This page only offers R 4.1, but as far back as 16.04 LTS
This page offers older R versions, but only back to 18.04 LTS
It's also possible that one of the backports on the Debian packages page would work on your system (it reports that 3.5.3 is available for Debian "jessie", although I have no idea how that lines up with Ubuntu releases).
I guess it's possible that one of those .debs works for your system though ... ? If you do install from .deb, you may have to be careful not to clobber your current version (e.g. using the --instdir argument to dpkg).
Building from source:
download the source tarball for R 3.5.3
untar, ./configure, make, sudo make install (assuming you have all the necessary development tools, system libraries, etc.; you'll have to troubleshoot/install as you go along)
It might be worth ./configure --prefix=/path/to/testdir to put the new version in a completely separate location, just to make extra-sure you don't stomp on your current install. (This would also simplify the library-path stuff below.)
Packages do need to be re-installed when switching major versions (e.g. 3.4.x to 3.5.x); one way to do it is to copy the system library of packages to a new place (adjust library paths as necessary; see R installation and administration manual).
Then, you should be able to update.packages(checkBuilt=TRUE, ask=FALSE) to update everything.
The tricky spots are (1) getting the library paths right (this will depend a bit on how things are set up in your existing installation; (2) it's conceivable that some current versions of packages on CRAN will fail to re-install/re-build under R 3.5.3. devtools::install_version() would help, although you'd have to track down the correct version manually. I recall someone posting about a package that would install an archived version by date, which could save a lot of poking around ...

How to view/change the installation of R that RStudio uses?

After installing either anaconda or jupyter, RStudio now shows some logs when installing packages, which indicate it's using R installed by anaconda, rather than the original version I had installed.
This is not a problem, until I try to install various packages, and I get some maze of frustrating c++ issues (due to graph dependencies).
What I've tried so far
Changed .libPaths() from the anaconda path to the default locations (but this doesn't help for R, only for R libraries)
Question
How can I tell which R installation RStudio is using, and how do I change it (from the anaconda version, back to the vanilla R version I previously had installed)
If you type version in the Rstudio console window it will tell you which version of R you are using...
> version
_
platform x86_64-w64-mingw32
arch x86_64
os mingw32
system x86_64, mingw32
status
major 3
minor 6.3
year 2020
month 02
day 29
svn rev 77875
language R
version.string R version 3.6.3 (2020-02-29)
nickname Holding the Windsock
>
previous relaeases of R can be found here:
https://cran.r-project.org/bin/windows/base/old/
To those still searching for an answer and stumbled here
As listed above, basic info on the current R version is found entering this in the console of your RStudio
version
To view which R version is being used:
R.home() #tells you the R working directory
RSTUDIO_WHICH_R #tells you the source location of the R instance being used
Changing the version of R being used is much trickier. Consulting the official documentation can help, but realistically its easiest on Windows and a hassle on Mac/Linux. There might be some sneakier issues with Mac/Linux profiles and config variables, detailed more here
Best of luck!

Cannot run R from terminal after upgrading to macOS Sierra

I recently updated my macbook to macOS Sierra (Version 10.12.3 (16D32)), and I am no longer able to run R directly from Terminal:
DN51ssqi:~ kjytay$ R
-bash: R: command not found
DN51ssqi:~ kjytay$ R --version
-bash: R: command not found
Opening R from the Applications folder or from RStudio works fine. Anyone experience this issue/has been able to fix it?
Here is my R version information:
platform x86_64-apple-darwin13.4.0
arch x86_64
os darwin13.4.0
system x86_64, darwin13.4.0
status
major 3
minor 3.2
year 2016
month 10
day 31
svn rev 71607
language R
version.string R version 3.3.2 (2016-10-31)
nickname Sincere Pumpkin Patch
This is just a guess, but I'm thinking this is probably an issue with your PATH settings, which might have been overwritten when you upgraded*. Seems worth a try at least. This is from the RStudio support pages**:
R from source (including MacPorts and Homebrew)
When R is installed from CRAN on OS X the R executable is installed at
/usr/bin/R. However, if R is installed directly from source or via a
package manager like MacPorts or Homebrew, then the R executable is
installed to either /usr/local/bin/R (Homebrew) or /opt/local/bin/R
(MacPorts). In order to support these variations, RStudio scans for
the R executable in the following sequence:
/usr/bin/R
/usr/local/bin/R
/opt/local/bin/R
If RStudio is not able to locate R by scanning these locations, it
will fall back to using whatever version of R is located at
/Library/Frameworks/R.framework/.
If RStudio is finding R OK, then you must have it at one of these locations. Make sure these locations are in your $PATH list:
In the Terminal:
echo $PATH
Will display your current PATHs list. If any of the locations in the RStudio quote are missing, you can see if that's where R is located by trying to specify that location. For example:
/usr/local/bin/R
If that works to start R, just add that location to your PATHs list:
export PATH=$PATH:/usr/local/bin
So that OSX knows where to find it!
* It's been noted elsewhere that homebrew breaks, for example, on upgrade to Sierra. Here's a blog post outlining some steps an R user might like to take after the upgrade: http://www.statsblogs.com/2017/01/26/upgrading-to-macos-sierra-nee-osx-for-r-users/
** Here's the support page where the quote is from https://support.rstudio.com/hc/en-us/articles/200486138-Using-Different-Versions-of-R

Install Spark on Windows for sparklyr

I have tried several tutorials on setting up Spark and Hadoop in a Windows environment, especially alongside R. This one resulted in this error by the time I hit figure 9:
This tutorial from Rstudio is giving me issues as well. When I get to the
sc <- spark_connect(master = "local")
step, I get this familiar error:
Error in force(code) :
Failed while connecting to sparklyr to port (8880) for sessionid (1652): Gateway in port (8880) did not respond.
Path: C:\Users\jvangeete\spark-2.0.2-bin-hadoop2.7\bin\spark-submit2.cmd
Parameters: --class, sparklyr.Backend, "C:\Users\jvangeete\Documents\R\win-library\3.3\sparklyr\java\sparklyr-2.0-2.11.jar", 8880, 1652
---- Output Log ----
The system cannot find the path specified.
---- Error Log ----
This port issue is similar to the one I get when trying to assign the "yarn-client" parameter inside spark_connect(...) as well, when trying it from Ms. Zaidi's tutorial, here. (That tutorial has its own issues, which I've put up on a board, here, if anyone's interested.)
The TutorialsPoint walkthrough gets me through fine if I first install an Ubuntu VM, but I'm using Microsoft R(RO) so I'd like to figure this out in Windows, not least of all because it appears that Mr. Emaasit is in the first tutorial able to run a command I cannot with .\bin\sparkR.
Most generally I am trying to understand how to install and run Spark together with R using preferably sparklyr, in Windows.
UPDATE 1: This is what's in the directories:
UPDATE 2: This is my R-session and system info
platform x86_64-w64-mingw32
arch x86_64
os mingw32
system x86_64, mingw32
status
major 3
minor 3.1
year 2016
month 06
day 21
svn rev 70800
language R
version.string R version 3.3.1 (2016-06-21)
nickname Bug in Your Hair
Download spark_hadoop tar from
http://spark.apache.org/downloads.html
install sparklyr package from carn
spark_install_tar(tarfile = "path/to/spark_hadoop.tar")
If you still getting error, then untar the tar manually and set spark_home environment variable points to spark_hadoop untar path.
Then try executing the following in the R console. library(sparklyr) sc <- spark_connect(master = "local").

RStudio can not use git in Yosemite

After upgrading my Mac to Yosemite, I am not able to use git in RStudio anymore.
(I can still use source tree or git independently from RStudio)
Not sure whether it is related to the PATH issue posted here:
Running system command from R console cannot locate installed programs since upgrading to Mac OSX 10.10
I tried the above solution, but did not work.
In RStudio, I specified the path to Git in Tools/Global Options.../"Git/SVN" correctly (as I used before)
But, in in Tools/Project Options.../"Git/SVN":Version control system the only option left is (None).
RStudio: 0.98.1074 (updated to 0.98.1083, still does not work)
version
_
platform x86_64-apple-darwin10.8.0
arch x86_64
os darwin10.8.0
system x86_64, darwin10.8.0
status
major 3
minor 1.0
year 2014
month 04
day 10
svn rev 65387
language R
version.string R version 3.1.0 (2014-04-10)
nickname Spring Dance
I encountered the same problem. When you enter the directory you used to use with git in your terminal (cd path/to/directory) type git status. In my case I received the message:
Agreeing to the Xcode/iOS license requires admin privileges, please re-run as root via sudo.
Apparently, I had to agree to the Xcode licence. When you re-run the line with sudo (sudo git status) and enter your password in the terminal you get the whole license displayed. Now you only need to type agree and everything is done. Re-start RStudio and the git functionality is back again.
Best wishes,
Marco

Resources