Difference between revisions of "R"
From WPKG | Open Source Software Deployment and Distribution
(install modules) |
(R version independent install) |
||
Line 1: | Line 1: | ||
This is a silent installer and uninstalled for [http://www.r-project.org/ R], a statistical programming language. Each version of R can be installed in parallel, however for cleanliness we don't want that, and so uninstall older versions. The components are listed in [https://svn.r-project.org/R/branches/R-2-9-branch/src/gnuwin32/installer/JRins.pl JRins.pl] however they've been reorganised in [https://svn.r-project.org/R/trunk/src/gnuwin32/installer/JRins.pl trunk] which will become 2.10, more details are in the[https://svn.r-project.org/R/trunk/src/gnuwin32/CHANGES CHANGES] file, under INSTALLATION. | This is a silent installer and uninstalled for [http://www.r-project.org/ R], a statistical programming language. Each version of R can be installed in parallel, however for cleanliness we don't want that, and so uninstall older versions. The components are listed in [https://svn.r-project.org/R/branches/R-2-9-branch/src/gnuwin32/installer/JRins.pl JRins.pl] however they've been reorganised in [https://svn.r-project.org/R/trunk/src/gnuwin32/installer/JRins.pl trunk] which will become 2.10, more details are in the[https://svn.r-project.org/R/trunk/src/gnuwin32/CHANGES CHANGES] file, under INSTALLATION. | ||
+ | |||
+ | This install works independed of the R version and installes always the newest R version. The "revision" has to be increased from time to time to trigger the upgrade of the package. | ||
<source lang="xml"> | <source lang="xml"> | ||
− | <package id="r" name="R" revision=" | + | <package id="r" name="R" revision="1" priority="0" reboot="false"> |
− | <check type="uninstall" condition="exists" path="R for Windows | + | <check type="uninstall" condition="exists" path="R for Windows.*" /> |
− | <install | + | <install include="remove" /> |
− | <install cmd='"% | + | <install cmd='"%TEMP%\R-release.exe" /SILENT' > |
− | + | <download url='http://cran.r-project.org/bin/windows/base/R-release.exe' target="R-release.exe" /> | |
− | + | <exit code="any"/> | |
− | + | </install> | |
− | < | + | <upgrade include="remove" /> |
− | <upgrade | + | <upgrade include="install" /> |
− | < | + | <remove cmd='"%COMSPEC%" /c for /d %r in ( "%PROGRAMFILES%\R\*.*" ) do if exist "%r\unins000.exe" "%COMSPEC%" /c "%r\unins000.exe" /silent'> |
− | + | <exit code="any" /> | |
− | + | </remove> | |
− | + | ||
− | < | + | |
− | + | ||
</package> | </package> | ||
</source> | </source> | ||
Line 22: | Line 21: | ||
To automatically install some packages, add the following: | To automatically install some packages, add the following: | ||
<source lang="xml"> | <source lang="xml"> | ||
− | < | + | <check type="execute" path='"%COMSPEC%" /c for /d %r in ( "%PROGRAMFILES%\R\*.*" ) do if exist "%r\bin\rscript.exe" "%r\bin\rscript.exe" -e "installed.packages()" | find /c "r_pkg_name" > NUL' condition="exitcodeequalto" value="0" /> |
− | < | + | <install cmd='"%COMSPEC%" /c for /d %r in ( "%PROGRAMFILES%\R\*.*" ) do if exist "%r\bin\rscript.exe" start /wait "r_pkg_name" "%r\bin\rscript.exe" "%SOFTWARE%\r\r_pkg_name.r"' > |
+ | <exit code="any" /> | ||
+ | </install> | ||
+ | <upgrade include="install" /> | ||
</source> | </source> | ||
where r-libraries.R contains install.packages() commands like this (change repos to your nearest [http://cran.r-project.org/mirrors.html CRAN mirror]): | where r-libraries.R contains install.packages() commands like this (change repos to your nearest [http://cran.r-project.org/mirrors.html CRAN mirror]): |
Revision as of 11:17, 1 April 2014
This is a silent installer and uninstalled for R, a statistical programming language. Each version of R can be installed in parallel, however for cleanliness we don't want that, and so uninstall older versions. The components are listed in JRins.pl however they've been reorganised in trunk which will become 2.10, more details are in theCHANGES file, under INSTALLATION.
This install works independed of the R version and installes always the newest R version. The "revision" has to be increased from time to time to trigger the upgrade of the package.
<package id="r" name="R" revision="1" priority="0" reboot="false">
<check type="uninstall" condition="exists" path="R for Windows.*" />
<install include="remove" />
<install cmd='"%TEMP%\R-release.exe" /SILENT' >
<download url='http://cran.r-project.org/bin/windows/base/R-release.exe' target="R-release.exe" />
<exit code="any"/>
</install>
<upgrade include="remove" />
<upgrade include="install" />
<remove cmd='"%COMSPEC%" /c for /d %r in ( "%PROGRAMFILES%\R\*.*" ) do if exist "%r\unins000.exe" "%COMSPEC%" /c "%r\unins000.exe" /silent'>
<exit code="any" />
</remove>
</package>
To automatically install some packages, add the following:
<check type="execute" path='"%COMSPEC%" /c for /d %r in ( "%PROGRAMFILES%\R\*.*" ) do if exist "%r\bin\rscript.exe" "%r\bin\rscript.exe" -e "installed.packages()" | find /c "r_pkg_name" > NUL' condition="exitcodeequalto" value="0" />
<install cmd='"%COMSPEC%" /c for /d %r in ( "%PROGRAMFILES%\R\*.*" ) do if exist "%r\bin\rscript.exe" start /wait "r_pkg_name" "%r\bin\rscript.exe" "%SOFTWARE%\r\r_pkg_name.r"' >
<exit code="any" />
</install>
<upgrade include="install" />
where r-libraries.R contains install.packages() commands like this (change repos to your nearest CRAN mirror):
Sys.setenv("http_proxy"="http://proxy.example.com:3128") install.packages("gbm", repos="http://cran.ms.unimelb.edu.au/") install.packages("Design", repos="http://cran.ms.unimelb.edu.au/") install.packages("rpart", repos="http://cran.ms.unimelb.edu.au/")