WINDOWS BATCH FILES FOR R - VERSION 0.1-2

INSTRUCTIONS

These batch files allow one to configure R on Windows XP (maybe 2000/NT
too but have only been tried on XP) so that one does not have
to reinstall libraries, site files and MiKTeX files each time one installs 
a new version of R.  Perform the configuration steps described below and
then just run Rrefresh.bat after each R upgrade.  The batch files
are independent except that Rcmd.bat is used by Rrefresh.bat and
makepkg.bat .

CONFIGURATION

Assuming that your R tree is C:\Program Files\R (its not necessary
to use that path but that is the default one used by the R installer
so for purposes of example we will use it here):

1. Place the batch files somewhere on your path.  To find out which
   folders are in your path issue the Windows console commmand:  path
   e.g. If C:\bin is a folder in your path then do this:
      copy *.bat C:\bin

2. Copy the *.site files into your R tree and edit them as desired:
   e.g.
      copy *.site "C:\Program Files\R"
   In particular change the default repository in Renviron.site to 
   the closest one.  A list is at: http://cran.r-project.org/mirrors.html

3. Optional. Ensure MiKTeX is installed.  A plain vanilla MiKTeX install 
   without changing any configuration files is all that is required.

4. Optional. Create a shortcut on the desktop to Rgui.bat and by right 
   clicking that desktop icon and choosing properties add a shortcut key 
   Alt+Ctrl+R so that that sequence runs the R gui.

NEW R VERSION

Each time a new version of R is installed or the *.site files are updated run:
  Rrefresh.bat 
in order to copy the *.site and miktex files to the appropriate places.
(If MiKTeX is not installed use:  Rrefresh.bat --no-miktex)

FILES

Description of various batch files here:

R.bat, Rcmd.bat, Rgui.bat - batch files which locate and run R.
  These files are identical.  They query their 0th argument to determine
  what to call.  See the top of the file for the algorithm for locating R.  
  Usually its via the registry.  They can be run with or without arguments.

Rrefresh.bat - this copies the *.site files to the appropriate 
  place in the most current R version installed and the miktex files
  from that R version to the appropriate miktex folder.  No arguments
  are required.  It is normally run each time one installs a new version
  of R or modifies any of the *.site files.  Use the --no-miktex argument
  if MiKTeX was not installed; otherwise, use no arguments.

Rfind.bat - will search system for various tools needed to make R packages.
  It does not actually change any environment variables or any other aspect
  of the system so it is always safe to run.  It takes no arguments.

makepkg.bat - called like this:
   makepkg install mypkg
   makepkg check mypkg
  No other arguments are accepted.
  This command is similar to rcmd install or rcmd check except that
  it first builds the package, which is necessary if one is using the R
  .Rbuildignore  facility.  Also it will set R_LIBS to .../R/library
  if R_LIBS is not already set. Note that certain flags are set near the top
  This file can be manually editted to change those as it does not itself
  take any flags.  If used with a second argument of install it will
  install the package in the library subfolder of the current folder.
  You probably don't need this file if you don't use .Rbuildignore .
  In that case just use Rcmd.bat instead in the usual way.

Renviron.site - sample Renviron.site file.  

Rprofile.site - sample Rprofile.site file.  Change the default 
  repository to the closest one.

COPYING/COPYRIGHT

See the COPYING and COPYRIGHT files in this directory.

ACKNOWLEDGEMENTS

See the THANKS file in this directory.

Gabor Grothendieck
ggrothendieck@gmail.com

