specifying R library path for RKernel in Anaconda Jupyter notebook

后端 未结 2 1124
野趣味
野趣味 2021-01-15 10:18

First let me preface this with the disclaimer that I\'m new to R, but a longtime Python power user. Given that I love the conda ecosystem and the Jupyter notebook, I\'m try

相关标签:
2条回答
  • 2021-01-15 10:37

    You can find out the path to your library with installed.packages()

    0 讨论(0)
  • 2021-01-15 10:48

    You can add .libPaths('path_where_your_packages_are') in a code cell at the beginning of your notebook to tell jupyter where your packages are. For me that was .libPaths('~/R/win-library/3.2') (work-around from discnerd who filed this issue on github).

    To find out the path to your packages, just install a random package in R and wait for the location to be printed to the console.


    More details (likely specific to my system/installations): When running .libPaths() in R, I got 2 locations: one for which admin rights were required for writing, and one for which admin rights were not required for writing. While packages installed through R land in the location where admin rights are not required, jupyter looks at the location where admin rights are required.

    0 讨论(0)
提交回复
热议问题