1

I have installed rstudio on my gnu/linux machine. For some scripts it downloaded and compiled some packages in '/home/saeid/R`. I tend to keep my home directory clean, so I want to move this R directory to somewhere else. But I couldn't find any options in the RStudio that asks/sets the directory for these packages.

Here is the listing of packages in this directory:

saeid@vostro:~/R/x86_64-pc-linux-gnu-library/3.0$ ls -l
total 88
drwxrwxr-x  7 saeid saeid 4096 Nov  8 13:36 bitops
drwxrwxr-x  7 saeid saeid 4096 Nov  8 13:36 caTools
drwxrwxr-x  8 saeid saeid 4096 Nov  8 13:36 digest
drwxrwxr-x  6 saeid saeid 4096 Nov  8 13:36 evaluate
drwxrwxr-x  9 saeid saeid 4096 Nov  8 13:36 formatR
drwxrwxr-x  7 saeid saeid 4096 Nov  8 13:36 highr
drwxrwxr-x  7 saeid saeid 4096 Nov  8 13:36 htmltools
drwxrwxr-x  8 saeid saeid 4096 Nov  8 13:38 httpuv
drwxrwxr-x  9 saeid saeid 4096 Nov  8 13:38 jsonlite
drwxrwxr-x 14 saeid saeid 4096 Nov  8 13:36 knitr
drwxrwxr-x  7 saeid saeid 4096 Nov  8 13:36 magrittr
drwxrwxr-x 11 saeid saeid 4096 Nov  8 13:36 markdown
drwxrwxr-x  7 saeid saeid 4096 Nov  8 13:35 mime
drwxrwxr-x  7 saeid saeid 4096 Nov  8 13:38 R6
drwxrwxr-x 15 saeid saeid 4096 Nov  8 13:37 Rcpp
drwxrwxr-x  9 saeid saeid 4096 Nov  8 13:37 RJSONIO
drwxrwxr-x  8 saeid saeid 4096 Nov  8 13:36 rmarkdown
drwxrwxr-x 11 saeid saeid 4096 Nov  8 13:38 shiny
drwxrwxr-x  8 saeid saeid 4096 Nov  8 13:36 stringi
drwxrwxr-x  7 saeid saeid 4096 Nov  8 13:36 stringr
drwxrwxr-x  8 saeid saeid 4096 Nov  8 13:37 xtable
drwxrwxr-x  8 saeid saeid 4096 Nov  8 13:36 yaml

So the question is where should I change the path of this directory for RStudio (I think there should be some config files that allow this, but I couldn't find it yet).

lmo
  • 37,904
  • 9
  • 56
  • 69
Dumbo
  • 13,555
  • 54
  • 184
  • 288

1 Answers1

1

You can check out .libPaths().

Hao
  • 7,476
  • 1
  • 38
  • 59
  • Thanks, but where/how I can check this? – Dumbo Nov 08 '15 at 14:50
  • Just type it in the R console if you are using Rstudio. – Hao Nov 08 '15 at 14:52
  • ok, I found it there is pointing to `"/home/saeid/R/x86_64-pc-linux-gnu-library/3.0"` so how can I set it to a new path permamently? – Dumbo Nov 08 '15 at 14:56
  • ok I got the idea here http://stackoverflow.com/questions/15170399/changing-r-default-library-path-using-libpaths-in-rprofile-site-fails-to-work – Dumbo Nov 08 '15 at 14:57
  • Yep, you got it. :) Yeah, i guess you do need to put it in your .Rprofile to make the change "permanent" – Hao Nov 08 '15 at 15:01