Difference between revisions of "R"

From HCL
Jump to: navigation, search
 
Line 1: Line 1:
 
http://cran.r-project.org/
 
http://cran.r-project.org/
  
Installation from sources:
+
== Installation from sources ==
  
 
1. R sould be configured as a shared library
 
1. R sould be configured as a shared library
Line 11: Line 11:
 
<source lang="bash">
 
<source lang="bash">
 
$ export R_HOME=DIR/lib/R
 
$ export R_HOME=DIR/lib/R
 +
$ export LD_LIBRARY_PATH=$R_HOME/lib:$LD_LIBRARY_PATH
 
</source>
 
</source>
 
3. Install required packages
 
3. Install required packages
Line 17: Line 18:
 
> install.packages(c(”sandwich”, ”strucchange”, ”zoo”))
 
> install.packages(c(”sandwich”, ”strucchange”, ”zoo”))
 
</source>
 
</source>
4. If R is intalled in a non-default directory
+
4. Set up developer environment
 
<source lang="bash">
 
<source lang="bash">
$ export LD_LIBRARY_PATH=$R_HOME/lib:$LD_LIBRARY_PATH
+
$ export CPATH=$R_HOME/include:$CPATH
 +
$ export LIBRARY_PATH=$R_HOME/lib:$LIBRARY_PATH
 
</source>
 
</source>

Latest revision as of 06:30, 16 March 2010

http://cran.r-project.org/

Installation from sources

1. R sould be configured as a shared library

$ ./configure --prefix=DIR --enable-R-shlib=yes
$ make install

2. Set up environment

$ export R_HOME=DIR/lib/R
$ export LD_LIBRARY_PATH=$R_HOME/lib:$LD_LIBRARY_PATH

3. Install required packages

$ DIR/bin/R
> install.packages(c(”sandwich”, ”strucchange”, ”zoo”))

4. Set up developer environment

$ export CPATH=$R_HOME/include:$CPATH
$ export LIBRARY_PATH=$R_HOME/lib:$LIBRARY_PATH