R Issues

RPubs SSL Error

Whoever has created a knitr project in RStudio and tried to publish it to RPubs must have faced an 'SSL Error' message. Apparently this is due to some proxy setting. This is the solution:

  • Create a text file and enter the following line in it: options(rpubs.upload.method = “internal”)

  • Save the file in the same directory as your knitr project. The file name should be .Rprofile

  • Note that the name starts with a dot (.)

  • Now change to the knitr project directory and compile your Rmd file.

Note

  • Windows does not allow you to create a file whose name starts with a dot. (Linux does not have this problem). If you have a Linux box or Android phone, it is easy to create this file and transfer it to Windows. Otherwise, R Studio comes to our rescue:

  • In R Studio console, type the following command:

  • file.edit(“.Rprofile”)

  • Now a fresh file window opens. It is a blank file with the name .Rprofile. In that window, type your magic line

  • options(rpubs.upload.method = “internal”) and save it.

  • Source(https://rpubs.com/ramaraja/SSLerror)

Updating R from R

# installing/loading the package:
if(!require(installr)) { 
install.packages("installr"); 
require(installr)
} #load / install+load installr

# using the package:
updateR() 
# this will start the updating process of your R installation.  It will check for newer versions, #and if one is available, will guide you through the decisions you'd need to make.