I have been using R Studio through which I have installed a large number of R libraries to my system. Recently I begun working through Jupyter Notebook with an R Kernel. However I am facing 2 problems:
a) I can not access libraries I have already installed in my system -- such as dplyr
b) I can not reinstall these libraries from within Jupyter Notebook:
install.packages("dplyr", dependencies = TRUE, repos = "http://cran.us.r-project.org")
Installing package into 'C:/Install/R_LIBS'
(as 'lib' is unspecified)
also installing the dependency 'tibble'
package 'tibble' successfully unpacked and MD5 sums checked
Warning message:
"cannot remove prior installation of package 'tibble'"
package 'dplyr' successfully unpacked and MD5 sums checked
Warning message:
"cannot remove prior installation of package 'dplyr'"
The downloaded binary packages are in
C:\Users\akonstantinidis\AppData\Local\Temp\RtmpqUPKMw\downloaded_packages
library(dplyr)
Error in library(dplyr): there is no package called 'dplyr'
Traceback:
1. library(dplyr)
2. stop(txt, domain = NA)
Your advice will be appreciated.
Edit
As Alistaire very helpfully and kindly suggested in the comment below this post, I run the command .libPaths() from within RStudio and the from within Jupyter Notebook.
The results were the following:
RStudio:
"C:/Install/R_LIBS" "C:/Program Files/Microsoft/R Server/R_SERVER/library"
Jupyter Notebook
'C:/Install/R_LIBS' 'C:/ProgramData/Anaconda3/R/library'
Then I changed the library paths so that:
.libPaths()
'C:/Install/R_LIBS' 'C:/Program Files/Microsoft/R Server/R_SERVER/library' 'C:/ProgramData/Anaconda3/R/library'
Nonetheless, when I tried to load the dplyr library I got the same error message:
library(dplyr)
Error in library(dplyr): there is no package called 'dplyr'
Traceback:
1. library(dplyr)
2. stop(txt, domain = NA)