6
edits
Changes
R
,R version independent install
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">
<package id="r" name="R" revision="2921" priority="0" reboot="false"> <check type="uninstall" condition="exists" path="R for Windows 2.9.2*" /> <install cmdinclude='"%PROGRAMFILES%\R\R-2.7.1\unins000.exeremove" /verysilent' ><exit code="any" /></install> <install cmd='"%PROGRAMFILESTEMP%\R\R-2.8.0\unins000release.exe" /verysilentSILENT' > <exit codedownload url="any" 'http:/></install> <install cmd='"%PROGRAMFILES%\R\Rcran.r-2project.8.1\unins000.exe" org/verysilent' ><exit code="any" bin/><windows/base/install> <install cmd='"%PROGRAMFILES%\R\R-2.9.0\unins000release.exe" /verysilent' ><exit codetarget="any" /></install> <install cmd='"%PROGRAMFILES%\R\R-2.9.1\unins000release.exe" /verysilent' > <exit code="any" /> </install> <install cmd='%SOFTWARE%\R\r-2.9.2-win32.exe /verysilent /componentsupgrade include="main,chtml,html,html/help,latex,manuals,manuals/basic,manuals/technical,manuals/refman,libdocs,devel,tcl,tcl/chm,Rd,transremove"' /> <upgrade cmdinclude='"%PROGRAMFILES%\R\R-2.7.1\unins000.exeinstall" /verysilent' ><exit code="any" /></upgrade> <upgrade remove cmd='"%PROGRAMFILESCOMSPEC%\R\R-2.8.0\unins000.exe" /verysilent' ><exit code="any" c for /></upgrade> <upgrade cmd='d %r in ( "%PROGRAMFILES%\R\R-2*.8.1\unins000.exe*" /verysilent' ><exit code="any" /></upgrade> <upgrade cmd=') do if exist "%PROGRAMFILES%\R\R-2.9.0r\unins000.exe" /verysilent' ><exit code="any%COMSPEC%" /></upgrade> <upgrade cmd='c "%PROGRAMFILES%\R\R-2.9.1r\unins000.exe" /verysilentsilent' > <exit code="any" /></upgrade> <upgrade cmd='%SOFTWARE%\R\base\r-2.9.2-win32.exe /verysilent /components="main,chtml,html,html/help,latex,manuals,manuals/basic,manuals/technical,manuals/refman,libdocs,devel,tcl,tcl/chm,Rd,trans"' /> <remove cmd='"%PROGRAMFILES%\R\R-2.9.2\unins000.exe" /verysilent' />
</package>
</source>
To automatically install some packages, add the following:
<source lang="xml">
<install cmdcheck type="execute" path='"%COMSPEC% " /c for /d %r in ( "%PROGRAMFILES%\R\R-2.9*.2*" ) do if exist "%r\bin\Rscriptrscript.exe" " %SOFTWARE%r\Rbin\rrscript.exe" -librariese "installed.R packages()" | find /c "r_pkg_name" > NUL' condition="exitcodeequalto" value="0" /><upgrade install cmd='"%COMSPEC% " /c for /d %r in ( "%PROGRAMFILES%\R\R-2*.9*" ) do if exist "%r\bin\rscript.2exe" start /wait "r_pkg_name" "%r\bin\Rscriptrscript.exe" " %SOFTWARE%\R\r-libraries\r_pkg_name.Rr"' > <exit code="any" /></install><upgrade include="install" />
</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]):