How to create .Renviron file?

后端 未结 4 1706
一生所求
一生所求 2020-12-16 14:15

I need to use my user defined folder where I stored my packages. I have referred the link given below.

R libraries installation

I have applied the same but i

4条回答
  •  谎友^
    谎友^ (楼主)
    2020-12-16 15:10

    Look at help(Startup) which has an example at the end:

     ## Example ~/.Renviron on Unix
     R_LIBS=~/R/library
     PAGER=/usr/local/bin/less
    
     ## Example .Renviron on Windows
     R_LIBS=C:/R/library
     MY_TCLTK="c:/Program Files/Tcl/bin"
    
     ## Example of setting R_DEFAULT_PACKAGES (from R CMD check)
     R_DEFAULT_PACKAGES='utils,grDevices,graphics,stats'
     # this loads the packages in the order given, so they appear on
     # the search path in reverse order.
    

    But note the spelling: Renviron with lower case e. Just use a text editor and edit the file. Also note that R has a variant in one of its system folder etc/ below its RHOME:

    edd@bud:~$ R RHOME
    /usr/lib/R
    edd@bud:~$ cat $(R RHOME)/etc/Renviron.site
    ##                                              Emacs please make this -*- R -*-
    ## empty Renviron.site for R on Debian
    ##
    ## Copyright (C) 2008 Dirk Eddelbuettel and GPL'ed
    ##
    ## see help(Startup) for documentation on ~/.Renviron and Renviron.site
    
    # ## Example ~/.Renviron on Unix
    # R_LIBS=~/R/library
    # PAGER=/usr/local/bin/less
    
    # ## Example .Renviron on Windows
    # R_LIBS=C:/R/library
    # MY_TCLTK="c:/Program Files/Tcl/bin"
    
    # ## Example of setting R_DEFAULT_PACKAGES (from R CMD check)
    # R_DEFAULT_PACKAGES='utils,grDevices,graphics,stats'
    # # this loads the packages in the order given, so they appear on
    # # the search path in reverse order.
    edd@bud:~$ 
    

    Hm. Looks like I wrote that for the Debian package and it does always exist. You can still copy it.

提交回复
热议问题