Control R environment using modules: Difference between revisions

From HPCwiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 1: Line 1:
== Setting up a semi-public repository ==


<source lang='bash'>
<source lang='bash'>
Line 4: Line 5:
</source>
</source>
Note: need to do this only once per version; make sure that the folder does not already exist.
Note: need to do this only once per version; make sure that the folder does not already exist.
== Create an R module ==


<source lang='bash'>
<source lang='bash'>
Line 35: Line 38:


</source>
</source>
== Load Module ==


   ----------------------------------- /cm/shared/apps/WUR/ABGC/modulefiles -----------------------------------
   ----------------------------------- /cm/shared/apps/WUR/ABGC/modulefiles -----------------------------------
Line 42: Line 47:
install.packages('car')
install.packages('car')
</source>
</source>
== Install R package and check install path ==


   > installed.packages()
   > installed.packages()
             Package      LibPath                                       
             Package      LibPath                                       
   car        "car"        "/cm/shared/apps/WUR/ABGC/R/R_libraries/3.0.2"
   car        "car"        "/cm/shared/apps/WUR/ABGC/R/R_libraries/3.0.2"
== See also ==
== External links ==

Revision as of 23:56, 29 November 2013

Setting up a semi-public repository

<source lang='bash'> mkdir /cm/shared/apps/WUR/ABGC/R/R_libraries/3.0.2 </source> Note: need to do this only once per version; make sure that the folder does not already exist.

Create an R module

<source lang='bash'> mkdir /cm/shared/apps/WUR/ABGC/modulefiles/R/ </source> Note: need to do this only once per version; make sure that the folder does not already exist.

<source lang='bash'> cp /cm/shared/modulefiles/R/3.0.2 /cm/shared/apps/WUR/ABGC/modulefiles/R/3.0.2_wur </source> Note: need to do this only once per version; make sure that the file does not already exist.

<source lang='tcl'>

  1. %Module1.0#######################################################################
    1. R3 modulefile modified for WUR/ABGC use

proc ModulesHelp { } {

       puts stderr "\tAdds R v3.0.2 to your environment and sets WUR/ABGC libraries"

}

module-whatis "Adds R v3.0.2 to your environment and set WUR/ABGC libraries"

set r3_root /cm/shared/apps/R3/ set r3_wur_root /cm/shared/apps/WUR/ABGC/R/R_libraries/3.0.2/

prepend-path PATH $r3_root/bin prepend-path MANPATH $r3_root/share/man prepend-path LD_LIBRARY_PATH $r3_root/lib64 prepend-path R_LIBS_SITE $r3_wur_root

</source>

Load Module

 ----------------------------------- /cm/shared/apps/WUR/ABGC/modulefiles -----------------------------------
 bwa/0.5.9   bwa/0.7.5a  R/3.0.2_wur

<source lang='rsplus'> install.packages('car') </source>

Install R package and check install path

 > installed.packages()
            Package      LibPath                                       
 car        "car"        "/cm/shared/apps/WUR/ABGC/R/R_libraries/3.0.2"

See also

External links