[Sciviews-commits] r225 - in komodo/SciViews-K: . R R/pkg content/js content/js/tools templates

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Tue Nov 10 17:19:53 CET 2009


Author: prezez
Date: 2009-11-10 17:19:52 +0100 (Tue, 10 Nov 2009)
New Revision: 225

Added:
   komodo/SciViews-K/R/
   komodo/SciViews-K/R/.Rprofile
   komodo/SciViews-K/R/ANNOUNCE
   komodo/SciViews-K/R/NEWS
   komodo/SciViews-K/R/R reference.kpz
   komodo/SciViews-K/R/R.bat
   komodo/SciViews-K/R/README
   komodo/SciViews-K/R/Rgui.bat
   komodo/SciViews-K/R/pkg/
   komodo/SciViews-K/R/pkg/svGUI_0.9-46.tar.gz
   komodo/SciViews-K/R/pkg/svGUI_0.9-46.tgz
   komodo/SciViews-K/R/pkg/svGUI_0.9-46.zip
   komodo/SciViews-K/R/pkg/svIDE_0.9-47.tar.gz
   komodo/SciViews-K/R/pkg/svIDE_0.9-47.tgz
   komodo/SciViews-K/R/pkg/svIDE_0.9-47.zip
   komodo/SciViews-K/R/pkg/svMisc_0.9-56.tar.gz
   komodo/SciViews-K/R/pkg/svMisc_0.9-56.tgz
   komodo/SciViews-K/R/pkg/svMisc_0.9-56.zip
   komodo/SciViews-K/R/pkg/svSocket_0.9-48.tar.gz
   komodo/SciViews-K/R/pkg/svSocket_0.9-48.tgz
   komodo/SciViews-K/R/pkg/svSocket_0.9-48.zip
   komodo/SciViews-K/R/print.help_files_with_topic.R
   komodo/SciViews-K/R/svStart.R
   komodo/SciViews-K/koextlib_R.py
   komodo/SciViews-K/koextlib_include_R_dir.patch
   komodo/SciViews-K/templates/print.help_files_with_topic.R
Modified:
   komodo/SciViews-K/content/js/commands.js
   komodo/SciViews-K/content/js/r.js
   komodo/SciViews-K/content/js/tools/file.js
   komodo/SciViews-K/install.rdf
   komodo/SciViews-K/templates/.Rprofile
   komodo/SciViews-K/templates/svStart.R
Log:
R startup directory moved (experimentally) from "templates" to "R". To build an xpi, this requires patching 'koextlib' python script or adding the directory manually to .xpi). 
Patch for koextlib is included (koextlib_include_R_dir.patch).
R packages moved to separate subdirectory 'pkg'.
More changes to Rprofile/svStart.R (now R tries to find komodo using system find commands on unix-based). Function "print.help_files_with_topic" moved to a separate file.
sv.tools.file functions rewritten to use komodo XPCOM (smaller code and considerably faster).

Added: komodo/SciViews-K/R/.Rprofile
===================================================================
--- komodo/SciViews-K/R/.Rprofile	                        (rev 0)
+++ komodo/SciViews-K/R/.Rprofile	2009-11-10 16:19:52 UTC (rev 225)
@@ -0,0 +1,5 @@
+source("svStart.R")
+
+svStart(trace = TRUE, pkg.dir="pkg")
+
+rm(svStart)

Added: komodo/SciViews-K/R/ANNOUNCE
===================================================================
--- komodo/SciViews-K/R/ANNOUNCE	                        (rev 0)
+++ komodo/SciViews-K/R/ANNOUNCE	2009-11-10 16:19:52 UTC (rev 225)
@@ -0,0 +1,93 @@
+
+Windows Batchfiles 0.5-0
+
+This is a set of Windows batch and javascript 
+utilities for use with R. 
+
+They run R and perform associated tasks involving
+R by finding R in the registry and then calling
+the appropraite utility so that no paths need be
+set -- an otherwise significant source of
+potential error when using R.  Also  the R
+installer inserts a key into the registry each
+each time R is upgraded and these utilities detect
+that and run accordingly simplifying upgrades
+by eliminating the need to reset paths.
+
+The following utilities are provided.  They are
+each mutually independent so any can be used
+without the others.  Installation consists only of
+copying whichever file or files is desired to any
+folder in the Windows PATH.  
+
+Legend:
+h = no args gives help
+0 = common usage is to enter command name without arguments
+
+#Rscript.bat - put at top of R file to make it a batch file (h)
+copydir.bat - copy a library from one version of R to another (h)
+el.js - run elevated - Vista and up, e.g. el Rgui  runs R elevated
+find-miktex.hta - GUI to find MiKTeX (0)
+jgr.bat - like jgr.exe but finds R from registry as well as JGR library (0)
+kopy.bat - copy Rcmd to other batch files (h)
+movedir.bat - move library from one version of R to another (h)
+R.bat - like R.exe but finds R from registry (0)
+Rcmd.bat - like Rcmd.exe but finds R from registry (h)
+RExcelVersion.hta - like Rversions.hta but also sets .RData association (0)
+Rgui.bat - like Rgui.exe but finds R from registry (0)
+RguiStart.bat - like Rgui.bat but arg1 defines folder to start R in
+Rscript.bat - run .R script (h)
+Rterm.bat - like rterm.exe but finds R from registry (h)
+Rtidy.bat - reformat a .R file, e.g. Rtidy myfile.R > outfile.R
+Rtools.bat - place Rtools on path for remainder of console session (0)
+Rversions.bat - list which versions of R are in registry (0)
+Rversions.hta - GUI interface to RSetReg.  List and set R version (0)
+show-svn-info.hta - show svn info if current folder is an svn checkout (0)
+Stangle.bat - run arg1 through Stangle (h)
+Sweave.bat - run arg1 through Sweave (h)
+
+Note that #Rscript.bat, R.bat, Rcmd.bat, Rgui.bat,
+RguiStart.bat, Rscript.bat, Rterm.bat, Rtools.bat
+and jgr.bat are all the same file but with
+different names.  The program checks what name it
+was called by and acts accordingly.  Similarly
+Sweave.bat and Stangle.bat are the same file with
+different names.
+
+The main new features in version 0.5-0 are:
+
+  o testing on XP32, XPx64, Vista32, Win7x64.
+    Thanks to Nicholas Hirschey.
+
+  o added defensive code to batch files to work
+    even in the presence of certain bad components
+    in pre-existing PATH variables.
+
+  o new command show-svn-info.hta which when run 
+    from a Tortoise SVN checkout folder shows some 
+    info about it.  Requires Tortoise SVN version 
+    1.5 or higher.
+
+  o new command find-miktex.hta can be run without
+	arguments from the Windows command line (or
+	double clicked from Windows Explorer).  It
+	will show the path to the MiKTeX bin folder.
+
+  o Rversions.hta now also changes the .RData
+    association and has been verified to work on
+    both XP and Vista.
+
+  o new RExcelversion.hta (also distributed with
+    RExcel) that is like Rversions.hta but also sets
+    the version for Rexcel at the same time.  Thanks 
+    to Erich Neumann.
+
+  o jgr.bat now passes the Windows library
+    directory name and R home directory name to
+    jgr.exe automatically
+
+More info and pointers to download site on CRAN
+can be found on the home page:
+
+	http://batchfiles.googlecode.com
+

Added: komodo/SciViews-K/R/NEWS
===================================================================
--- komodo/SciViews-K/R/NEWS	                        (rev 0)
+++ komodo/SciViews-K/R/NEWS	2009-11-10 16:19:52 UTC (rev 225)
@@ -0,0 +1,254 @@
+Changes in version 0.5-0
+
+  o new command show-svn-info.hta when run from a Tortoise SVN checkout
+    folder shows some info about it.  Requires Tortoise SVN version 1.5
+    or higher.
+
+  o new command find-miktex.hta can be run without arguments from the
+    Windows command line or double clicked it from Windows Explorer 
+    and it will show the path to the MiKTeX bin directory.
+
+  o Rversions.hta now also changes the .RData association and has
+    been verified to work on both XP and Vista.
+
+  o new RExcelversion.hta (also distributed with RExcel) that is like
+    Rversions.hta but also sets the version for Rexcel at the same time
+    and has been verified to work on both XP and Vista.
+
+  o jgr.bat now passes the Windows library and R home to jgr.exe automatically
+
+  o added defensive code to allow code to work even in the presence of
+    certain bad PATH variables
+
+  o testing on XP32, XPx64, Vista32, Win7x64 (thanks to Nicholas Hirschey)
+
+Changes in version 0.4-3
+
+  o Sweave.bat and Stangle.bat were not automatically finding MiKTeX.  
+    Fixed.
+
+Changes in version 0.4-2
+
+  o can optionally work off initialization files in place of registry.
+    Place rbatchfilesrc.bat in current directory or %userprofile% (so 
+    different directories can work off different versions of R, say) 
+    or same directory as the other batchfiles and it will run it first.
+    Typically rbatchfiles.bat would constain these two lines or similar:
+		set R_HOME=C:\Program Files\R\R-2.7.0
+		set R_TOOLS=C:\Rtools
+
+  o added Stangle.bat
+
+Changes in version 0.4-1
+
+  o it is no longer necessary to set any paths to build R packages
+    provided Rtools 2.7 or later is used.  Rcmd.bat and the other
+    scripts automatically find Rtools from the registry (including perl)
+    and if MikTeX is at %ProgramFiles%\MiKTeX* or %SystemDrive%:\MiKTex  
+    then it will find MiKTeX too.  New optional environment variables 
+    R_TOOLS and R_MIKTEX are available to force specified paths to be used.
+
+  o new Rtools.bat command that sets the path for the current cmd instance
+    to the one that R*.bat files use internally.  That is, rtools/bin,
+    rtools/perl/bin, rtools/MinGW/bin and MiKTeX .../miktex/bin are added 
+    to the path.  This is not needed to run or install R programs but only
+    if you want to access the rtools for other purposes.
+
+  o new el.js command which runs the command given as its argument elevated.
+    e.g. el cmd
+
+Changes in version 0.4-0
+
+  o as of 0.4-0 batchfiles is being developed and tested on Vista.
+    It may still work on XP but if any of the commands do not then use
+    version 0.3-2 instead since that was exclusively tested on XP.
+
+  o added RguiStart.bat which is like Rgui.bat but takes a single argument
+    which is a directory and starts up there
+
+  o the dependency of sweave.bat on Rterm.bat was eliminated so all
+    batch and javascript programs in this collection are now independent
+    of each other and have no dependencies aside form R.  (The perl
+    program, toggleDoc.pl, is does depend on perl and toggleDoc.js.)
+
+  o added info on how to use RguiStart.bat and sweave.bat with SendTo
+    folder
+
+  o misc improvements to README file
+
+  o improved help message given by sweave.bat when issued with no arguments
+
+  o removed only tested on XP messages since they work on Vista
+
+  o changed algorithm in Rversions.bat.  Now it checks current directory,
+    R_HOME and all keys in R's portion of the registry plus all sibling
+    folders of those mentioned.  Also it runs RSetReg.exe elevated
+    on Vista.  New version has not been tested on XP; however, older
+    versions are still available and were tested on XP.
+
+  o updated copydir.bat portion of README to discuss additional alternatives
+
+  o removed find-miktex.bat, Rfind.bat and makepkg.bat (they are still
+    available in batchfiles version 0.3-2)
+
+  o added toggleDoc.pl/toggleDoc.js which adds a toggle box to each 00Index.html
+    which when checked collapses similar HTML help lines into one.  Contributed
+    by Dieter Menne.
+
+Changes in version 0.3-2
+ 
+  o sweave.bat now uses Rterm.bat rather than Rcmd.bat which makes it usable
+    with a basic R installation (i.e. sh.exe not needed).  Previously it
+    required Rcmd.bat but now it requires Rterm.bat instead.
+
+  o added Rterm.bat (just a copy of Rcmd.bat)
+
+Changes in Version 0.3-1
+
+  o new find-miktex.bat which lists the mixktex folders from the registry
+
+  o new Rscript.bat which allows one to use the Rscript facility in 
+    R 2.5.0 and later without changing pathnames.  Just place Rscript.bat
+    in any existing path and it will automatically find the
+    current version of R from the registry and run the Rscript.exe that
+    is there.
+
+  o runR.bat.  If you have an R script such as myfile.R then you can create
+    a batch script for it by copying runR.bat to myfile.bat.  Then when you
+    issue the command myfile or myfile.bat it will run the R script in
+    myfile.R .  Just place myfile.bat and myfile.R anywhere in your path.  
+    This uses Rscript.bat .
+
+  o #Rscript.  If you have an Rscript called myfile.R, say, then if you
+    copy the script to myfile.bat and place 
+       #Rscript %0 %*  
+    as the first line with the remainder being the R commands then issuing
+    the command myfile or myfile.bat will run the R script.  The advantage
+    over the runR.bat method is that there is only one file, myfile.bat.
+    You don't need myfile.R anymore.  The disadvantage is that it will 
+    echo the #Rscript line to stdout.  This will be fixed if and when 
+    Rscript ever gets the perl/python/ruby -x flag.  (The runR approach will 
+    not echo additional lines but does require two files.)  
+
+  o new Rtidy.bat is a sample Rscript that uses the #Rscript facility
+    based on George Georgalis' UNIX code
+
+  o withgs.bat now checks for latest ghostscript version.  (Previously 
+    version was hard coded and it only worked for that version.)
+
+Changes in Version 0.3-0
+
+  o sweave now generates a second .pdf ending which is a copy of the first
+    but has a unique name and displays that.  This works around a problem
+    with acrobat that it will not display two files with the same name
+    at the same time.
+
+  o new --tex, --pdf, --nobck.pdf switches are available on sweave.  Also
+    expanded help when entering sweave without args.
+    
+Changes in Version 0.2-9
+
+  o updated README and other documentation files and inline documentation
+
+  o added sweave.bat
+ 
+  o new google code home page and svn repository
+    http://code.google.com/p/batchfiles/
+
+Changes in Version 0.2-8
+
+  o bug fix in copydir.bat and movedir.bat
+
+Changes in Version 0.2-7
+
+  o removed extra popup from Rversions.hta
+
+  o Rfind.bat now looks in registry for MiKTeX, replacing
+    previous heuristic.  [Thanks for help from Duncan
+    Murdoch].  Also RToolsDir typo fixed in Rfind.bat.
+
+Changes in Version 0.2-6
+
+  o batch files no longer use short names internally since this
+    triggers a bug in Windows batch in the case of the new R
+    folder naming conventions.
+
+  o Rversions.hta - fix for path names with spaces
+
+  o Rrefresh.bat has been removed (after having been deprecated in
+    in previous versions of batchfiles).
+
+  o tested movedir.bat by using it to upgrade R-2.2.0pat to R-2.2.1.  
+    See instructions in README.
+
+Changes in Version 0.2-5
+
+  o added movedir.bat which moves libraries from one version of
+    R to another.  This is like copydir.bat but is much faster and
+    can be used when the older version of R is no longer needed
+    (unlike copydir.bat which preserves the older version).  See
+    README for usage.
+
+Changes in Version 0.2-3
+
+  o added copydir.bat which can copy libraries from one version of
+    R to another.  (This is a temporary solution until R provides
+    facilities for upgrading the libraries, expected in R 2.3.0 .)
+    See README for usage.
+    
+  o eliminated all code associated with reading and manipulation of
+    R_ENVIRON, R_PROFILE and R_LIBS simplifying the batch files.  Use
+    copydir.bat instead.
+
+  o Rversions.hta is a javascript GUI version of Rversions.bat 
+
+Changes in Version 0.2-2
+
+  o added jgr.bat which starts up the JGR GUI.
+
+  o added Rversions.bat which can list the directories of all R versions 
+    available and can set one to become the current R version.
+
+  o all batch scripts which used the environment variable name Rrw now 
+    use the environment variable name R_HOME instead.
+
+  o Rcmd.bat, Rgui.bat, R.bat, jgr.bat files will now read R_ENVIRON, 
+    if present, and set the R_LIBS definition in it, if present (unless
+    R_LIBS is already defined as an environment variable).  All R_ENVIRON
+    file syntax accepted by R is supported including comments (#), 
+    var=value, var=${foo-bar} and recursions, var=${A-${B-C}}.
+
+  o makepkg.bat internals were simplified due to previous point.
+
+  o updated WISHLIST.
+
+  o updated THANKS.
+
+  o updated README.  More introductory information.  Also instructions 
+    for Rgui shortcut will disable screen flash on startup. Corrections.
+
+Changes in Version 0.2-1
+
+  o improvements to README
+
+Changes in Version 0.2-0
+
+  o can now support configurations without *.site files (as well as
+    configurations with *.site files) thereby reducing the minimum 
+    configuration even further.  
+
+  o Rcmd.bat, Rgui.bat and R.bat now temporarily set R_ENVIRON,
+    R_PROFILE and R_LIBS as needed so that it is no longer necessary to 
+    copy the *.site files into the etc directory eliminating all
+    reconfiguration when upgrading to a new version of R (except for
+    refreshing MiKTeX).
+
+  o new command miktex-refresh.bat is used to refresh MiKTeX after a
+    new version of R is installed. Previously this was done in
+    Rrefresh.bat which is now deprecated.  Rrefresh.bat is no longer 
+    needed (unless you want each R version to have its own *.site files).
+
+  o new NEWS, WISHLIST and RESOURCES files.
+
+  o README provides additional details.
+

Added: komodo/SciViews-K/R/R reference.kpz
===================================================================
(Binary files differ)


Property changes on: komodo/SciViews-K/R/R reference.kpz
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: komodo/SciViews-K/R/R.bat
===================================================================
--- komodo/SciViews-K/R/R.bat	                        (rev 0)
+++ komodo/SciViews-K/R/R.bat	2009-11-10 16:19:52 UTC (rev 225)
@@ -0,0 +1,148 @@
+
+ at echo off
+if /i "%1"==path (path %2) && goto:eof
+
+setlocal
+:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:: Placing this file in your path will allow rcmd to be run anywhere
+:: without changing your path environment variable.  See comments
+:: below on how it finds where R is.  Your path can be listed by
+:: the Windows console command:  path
+:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+
+rem at one tine this script had only been tested on XP
+rem recent tests have only been on Vista
+rem ver | findstr XP >NUL
+rem if errorlevel 1 echo Warning: This script has only been tested on Windows XP.
+
+set scriptdir_=%~dp0
+set lookin=.;%userprofile%;%scriptdir_%
+if not defined R_BATCHFILES_RC (
+	for %%f in ("rbatchfilesrc.bat") do set "R_BATCHFILES_RC=%%~$lookin:f"
+)
+if defined R_BATCHFILES_RC (
+	if exist "%R_BATCHFILES_RC%" call %R_BATCHFILES_RC%
+)
+
+:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:: use environment variable R_HOME if defined
+:: else current folder if bin\rcmd.exe exists 
+:: else most current R as determined by registry entry
+:: else error
+:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+if not defined R_HOME if exist bin\rcmd.exe set R_HOME=%CD%
+if not defined R_HOME for /f "tokens=2*" %%a in (
+ 'reg query hklm\software\R-core\R /v InstallPath 2^>NUL ^| findstr InstallPath'
+  ) do set R_HOME=%%~b
+if not defined R_HOME for /f "tokens=2*" %%a in (
+ 'reg query hklm\software\wow6432Node\r-core\r /v InstallPath 2^>NUL ^| findstr InstallPath'
+  ) do set R_HOME=%%~b
+if not defined R_HOME echo "Error: R not found" & goto:eof
+
+:: add R_MIKTEX to PATH if defined.  Otherwise if its not 
+:: in the PATH already then check \Program Files\miktex* or \miktex* 
+:: and if found add that to PATH.
+
+:: if miktex found in PATH skip searching for it
+PATH | findstr /i miktex > nul
+if not errorlevel 1 goto:end_miktex
+
+:: check for presence of %ProgramFiles%\miktex* or \miktex*
+
+if not defined R_MIKTEX for /f "delims=" %%a in (
+    'dir /b /on "%ProgramFiles%"\miktex* 2^>NUL'
+) do set R_MIKTEX=%ProgramFiles%\%%a
+
+if not defined R_MIKTEX for /f "delims=" %%a in (
+    'dir /b /on %SystemDrive%:\miktex* 2^>NUL'
+) do set R_MIKTEX=%SystemDrive%:\miktex\%%a
+
+:end_miktex
+if defined R_MIKTEX PATH %R_MIKTEX%\miktex\bin;%PATH%
+
+if not defined R_TOOLS for /f "tokens=2*" %%a in (
+ 'reg query hklm\software\R-core\Rtools /v InstallPath 2^>NUL ^| findstr InstallPath'
+ ) do set R_TOOLS=%%~b
+if not defined R_TOOLS for /f "tokens=2*" %%a in (
+ 'reg query hklm\software\wow6432Node\Rtools /v InstallPath 2^>NUL ^| findstr InstallPath'
+  ) do set R_TOOLS=%%~b
+
+set PATHQ=%PATH%
+:WHILE
+    if "%PATHQ%"=="" goto WEND
+    for /F "delims=;" %%i in ("%PATHQ%") do if exist "%%~sfi" set PATH2=%PATH2%;%%~sfi
+    for /F "delims=; tokens=1,*" %%i in ("%PATHQ%") do set PATHQ=%%j
+    goto WHILE 
+:WEND
+
+set path2=%path2:~1%
+
+if defined R_TOOLS (
+    set path2=%R_TOOLS%\bin;%R_TOOLS%\perl\bin;%R_TOOLS%\MinGW\bin;%PATH2%
+)
+
+path %path2%
+
+set here=%CD%
+set args=%*
+
+:: get name by which this command was called
+:: this allows same file to be used for Rgui, Rterm, etc. by just renaming it
+for %%i in (%0) do set cmd=%%~ni.exe
+
+if /i %cmd%==rtools.exe (endlocal & set path=%path2%) && goto:eof
+
+cd %R_HOME%\bin
+if /i not %cmd%==rguistart.exe goto:notRguiStart
+  set cmd=rgui.exe
+  set firstArgument=%1
+  if defined firstArgument (
+    dir %1 | findstr "<DIR>" > nul
+    if errorlevel 1 goto:notRguiStart
+    set here=%~1
+    set firstArgument=
+  )
+  set args=
+  shift
+  :startloop
+  set firstArgument=%1
+  if defined firstArgument (
+     set args=%args% "%~1" 
+     shift
+     goto:startloop
+  )
+:notRguiStart
+
+set st=
+if /i %cmd%==rgui.exe set st=start
+if /i %cmd%==#rscript.exe set cmd=rscript.exe
+cd %here%
+set cmdpath=%R_HOME%\bin\%cmd%
+
+:: if called as jgr.bat locate the JGR package to find jgr.exe
+if /i not %cmd%==jgr.exe goto:notJGR
+  set st=start
+  set st
+  set cmdpath=jgr.exe
+  set cmdpath
+  if not defined JGR_LIBS set JGR_LIBS=%R_LIBS%
+  for %%a in ("%R_HOME%\bin\Rscript.exe") do set RSCRIPT=%%~sfa
+  if not defined JGR_LIBS for /f "usebackq delims=" %%a in (
+		`%RSCRIPT% -e "cat(.libPaths(),sep=';')"`
+  ) do set JGR_LIBS=%%~a
+  if not defined JGR_LIBS (
+	echo "Error: JGR package not found in R library" & goto:eof
+  )
+  for %%f in ("JGR") do set "jgrpkg=%%~$JGR_LIBS:f"
+  set JGR_LIB=%jgrpkg:~0,-4%
+  for %%a in ("%JGR_LIB%") do set JGR_LIB_SHORT=%%~sfa
+  for %%a in ("%R_HOME%") do set R_HOME_SHORT=%%~sfa
+  set args=--libpath=%JGR_LIB_SHORT% --rhome=%R_HOME_SHORT%
+
+:notJGR
+
+if defined st (start "" "%cmdpath%" %args%) else "%cmdpath%" %args%
+goto:eof
+
+
+endlocal

Added: komodo/SciViews-K/R/README
===================================================================
--- komodo/SciViews-K/R/README	                        (rev 0)
+++ komodo/SciViews-K/R/README	2009-11-10 16:19:52 UTC (rev 225)
@@ -0,0 +1,361 @@
+batchfiles contains batch and GUI files for installing and maintaing R.  
+
+License.  GPL-2.  See COPYING file.
+
+NEWS.  See NEWS file.
+
+INSTALLATION
+
+To use any of these utilities just make sure that they are either
+in the current directory you are using or else are anywhere in your
+PATH.  No installation is necessary.  The utilities are all 
+written in Windows batch or javascript as HTA files and have
+no dependencies.
+
+Note that R.bat, Rcmd.bat, Rscript.bat, Rgui.bat, JGR.bat and RguiStart.bat
+are actually all the same file.  When any of them are run they check what
+name is was called by to determine what to do.  Similarly Sweave.bat and
+Stangle.bat are the same file.
+
+BATCH & JAVASCRIPT PROGRAMS (also see separate section for perl programs)
+
+0. Rtools.bat
+1. R.bat, Rcmd.bat, Rscript.bat, Rgui.bat, JGR.bat
+2. #Rscript.bat
+3. RguiStart.bat
+4. Sweave.bat and Stangle.bat
+5. Rversions.hta
+6. copydir.bat
+7. movedir.bat
+8. find-miktex.hta
+
+
+0. Rtools.bat.  Sets path to what Rcmd.bat and others use internally.
+This only sets the path for the current command shell instance.
+
+1. R.bat, Rcmd.bat, Rscript.bat, Rgui.bat, Rscript.bat, JGR.bat - are front
+ends to  the corresponding .exe files.  They locate R in the registry (and also
+look in a few other places if not found there).  Then they look for Rtools and
+MiKTeX and if found they add them temporarily to the path.  (Rtools and MiKTeX
+are needed when building R packages from source but are not needed for just
+running R nor are they need to download and install binary packages from CRAN.)
+Then they run R.exe, Rcmd.exe, Rscript.exe, Rgui.exe or JGR.exe with the same
+arguments.    They are actually all the same file just renamed.  (RguiStart.bat
+described separately is also the same file and all the code from this file is
+also at the end of Sweave.bat, also described separately.)  The file checks
+what name it was called by and acts accordingly.
+
+Their main advantages are:
+- you don't have to modify your path just to run R.
+- you don't have to modify your path to build R packages from source.
+- when you upgrade R they automatically work without change
+  since they will pick up the new version of R from the registry
+  automatically.
+- Sweave.bat and Stangle.bat, unlike, Rcmd Sweave and Rcmd Stangle
+  do not depend on rtools.
+
+You can put Rgui.bat on your desktop and associate a Windows
+ShortCut key (http://support.microsoft.com/kb/310417) with
+it so that you can just press the Windows key and
+R, say, to activate R.
+
+Here are some examples of using them from the command line.
+It assumes you have placed el.js, Rcmd.bat and Rgui.bat in
+your path.  el cmd spawns a command console with Administrator
+rights.  This is needed to build HTML help but you can omit
+the el command if you don't need that.
+
+    el cmd
+	Rcmd check mypackage 
+	Rcmd build mypackage
+	Rcmd build mypackage --binary
+	Rcmd INSTALL mypackage_1.0-0.tar.gz
+	Rcmd INSTALL mypackage_1.0-0.tar.gz -l library
+	Rscript myprog.R < mydata.dat
+	Rgui
+
+(When installing packages on Vista it is recommended that
+you do this from within a console session that has Administrator
+rights.  It will typically work even without that; however, the
+HTML help will not be created.)
+
+Older version of the Rcmd BATCH command in R had problems
+with spaces in pathnames so be sure you use a sufficiently
+recent version of R.  If you are using an old version of R
+that has problems use the short name corresponding to any
+long name with spaces:
+
+For example, suppose we have a file 
+   C:\Documents and Settings\Administrator\myfile.R .
+Then try this:
+
+	cd \
+	dir/x doc*
+	Rcmd BATCH c:\docume~1\Administrator\myfile.R
+
+where the dir/x command showed us the short name corresponding to
+the longer space-embedded name: Documents and Settings.  
+
+2. #Rscript.bat
+
+#Rscript.bat can be used as the first line of an R script to make 
+it callable as a batch file.  For example, if we have a myfile.R
+file then we can create a myfile.bat file that looks like this:
+
+#Rscript %0 %*
+...R code from myfile.R goes here...
+
+and now we can just issue the command myfile to run it.  We
+no longer need myfile.R.
+
+See the Rtidy.bat file for an example.  Note that it does have 
+the disadvantage that the output of the R program starts off 
+with the command itself.  R needs to be able to handle the 
+perl/python/ruby -x switch.  In the meantime #Rscript.bat 
+will mainly be useful for those scripts where the output does 
+not go to the standard output or where the addition of this 
+line is acceptable.
+
+3. RguiStart.bat
+
+This is like Rgui.bat except it intercepts the first argument
+and interprets it as the folder in which to start R (or if its
+an .Rdata file then it interprets it as the .Rdata file to start 
+R with).  The main reason for its existence is so that you can 
+place it in your SendTo folder.  On Vista do this:
+
+  copy RguiStart.bat %APPDATA%\Microsoft\Windows\SendTo
+
+Then, on Vista, when you are in Windows Explorer you can right click 
+on any folder in your user area and choose SendTo.  From the SendTo
+menu choose RGuiStart.bat to start up R in that folder.  If you 
+right click on an .Rdata file rather than a folder then R will
+start up with that file loaded (although in that case its probably
+easier to just double click the .Rdata file provided you have
+file type associations set up -- if you don't then the RguiStart.bat
+will provide an alternative).
+
+A second possibility is to place RguiStart.bat on your desktop and
+then drag a folder to it to start R in that folder.
+
+A third possibility is to just shift right click a folder in Windows
+Explorer and choose Open Command Window Here and then when the command
+window opens enter Rgui assuming you have placed Rgui.bat somewhere in
+your path.
+
+4. Sweave.bat and Stangle.bat - will run Sweave, then pdflatex and then
+display latex file.  Stangle.bat will run Stangle producing an R file.
+Unlike Rcmd Sweave and Rcmd Stangle these do not depend on rtools.
+Sweave.bat and Stangle.bat are actually the same file.  The file determines
+what to do by looking at the name by which it was called.
+
+      Sweave mydoc.Rnw
+   or
+      Sweave mydoc 
+
+The script runs Sweave, pdflatex and then displays the pdf
+file (assuming the user has .pdf extension associated with a
+pdf viewer).  If there is an error in Sweave or the .tex
+file is not newer than the Sweave'd file the script stops.
+Similarly if there is an error in pdflatex or the .pdf is
+not newer than the .tex file then the script stops.  Note
+that _two_ .pdf files are generated.  They are identical
+except one has a unique name created by suffixing the base
+with the date and time and .bck.pdf.  The one with the unique name 
+is the one viewed.  This overcomes problems of not being able to
+view the .pdf if the .pdf from a prior run is current being
+viewed (which would happen since by default the Acrobat viewer 
+won't allow you to view two files of the same name concurrently).
+Every so often the user should delete all *.bck.pdf files.
+
+Try:
+
+sweave
+
+without arguments to see options and get more info.
+
+Aside from using sweave from the command line, if you place
+sweave.bat in your SendTo folder as discussed under
+RguiStart.bat you can right click .Rnw files and choose
+SendTo > sweave to sweave them.
+
+You may need to copy Sweave.sty to the directory containing
+your .Rnw sweave file to use sweave.bat .
+
+5. Rversions.hta - This displays a GUI that lists all
+versions of R on your system  and allows you to choose one
+as your default, setting the  registry appropriately.  Just
+run without arguments, .e.g.  
+
+	Rversions.hta 
+
+For example, suppose we want to check a package using two
+different versions of R.  Then run 
+
+	Rcmd check mypkg
+
+	:: in next command set different version of R
+	Rversions.hta 
+	Rcmd check mypkg
+
+	:: in next command reset to original version of R
+	Rversions.hta 
+
+5. Rversions.bat - similar to Rversions.hta but 
+-- its batch whereas Rversions.hta is GUI
+-- uses slightly different heuristic to find R versions
+-- run without args to list versions available; run with any of
+   the listed versions to set that as the new version
+-- both forms work on XP; to run arg form on Vista run it elevated
+
+Examples:
+
+	:: list R versions
+	rversions.bat
+
+	:: check mypkg using R current version, 2.4.0, say
+	Rcmd check mypkg
+
+	:: switch to version R-2.5.0 and recheck
+	rversions R-2.5.0
+	Rcmd check mypkg
+
+	:: reset back to version 2.4.0
+	rversions.bat R-2.4.0
+
+6. copydir.bat - can be used to copy the libraries from an
+old version of R to your new one.  It will not overwrite any
+libraries already there so it should be safe to use. e.g. to
+upgrade R to a new version
+
+  :: Example is for upgrading from R-2.4.1 to R-2.5.0
+
+  :: first, download and install R-2.5.0, say
+  :: now perform the next two commands at the Windows console
+  cd \Program Files\R
+  copydir R-2.4.1\library R-2.5.0\library
+
+  :: next command only needed if you have *.site files
+  copy R-2.4.0\etc\*.site R-2.5.0\etc
+
+  :: ... now startup new version of R (R 2.5.0 in this example)
+  # issue this command in R 2.5.0
+  update.packages(checkBuilt = TRUE, ask = "graphics")
+  # or (see note below)
+  update.packages(ask = "graphics")
+
+  :: press OK and it will update those packages as necessary
+
+  # ... optionally check for deprecated packages
+  # 1. first select all repositories that you use with menu:
+  #    Packages | Repositories
+  # 2. second check if there are any deprecated packages that
+  #    were copied over but are not longer on CRAN or other repository
+  dp <- setdiff(installed.packages()[,1], available.packages()[,1])
+  # look at what we have
+  dp
+  # if you wish to remove them issue the remove.packages command:
+  # remove.packages(dp)
+
+  :: ... exit R and start it up again ...
+
+Note that the checkBuilt=TRUE argument will potentially
+cause all your packages to be downloaded again so you could
+try leaving it off and then reissue the command with
+checkBuilt=TRUE later only if you run into problems.  I
+normally do it without the checkBuilt=TRUE.
+
+It is anticipated that this command will ultimately be
+superceded by functionality in the R setup procedure at
+which time this will be deprecated.  Note that this method
+of just copying libraries may not work depending on the
+versions of R involved.  If its necessary to re-install most
+packages it can be done by issuing the following R command
+after performing the copydir.bat:
+install.packages(installed.packages()[,1])
+ 
+(Note that 2.8 of the R Windows FAQ
+
+http://cran.r-project.org/bin/windows/base/rw-FAQ.html#What_0027s-the-best-way-to-upgrade_003f
+
+refers to copying any installed package to the library
+folder but does not address how to accomplish that.  That
+omission is what copydir.bat addresses.)
+
+An alternative to copydir is to reinstall all packages
+
+	# Alternative to copydir.bat #1
+	# this example is for moving from 2.4.1 to 2.5.0
+	# run this in R 2.5.0
+	setwd(R.home())
+	ip <- installed.packages(lib.loc = "../R-2.4.1/library")
+	ip <- ip[ip[,1]!="base" ,1]
+	install.packages(ip)
+
+The above is taken from:
+https://www.stat.math.ethz.ch/pipermail/r-help/2007-May/131806.html
+Note that you may still have to use movedir.bat or copydir.bat
+after the above if it fails to install everything.  Since movedir.bat
+and copydir.bat won't overwrite anything this should be safe.
+
+	# Alternative to copydir.bat #2
+	#---run in previous version, e.g. R 2.4.1
+	packages <- installed.packages()[,"Package"]
+	save(packages, file = "~/Rpackages")
+
+	#---run in new version, e.g. R 2.5.0
+	load("~/Rpackages")
+	install.packages(setdiff(packages, installed.packages()[,"Package"]))
+
+	file.remove("~/Rpackages")
+
+This copydir alternative is based on:
+https://www.stat.math.ethz.ch/pipermail/r-help/2007-May/131131.html
+
+7. movedir - same arguments as copydir.  Only difference is
+that it moves the directories rather than copying them.  This
+can be used if you are no longer interested in using the
+packages with the old version of R other than by
+reinstalling them.)  This has the advantage that its much
+faster than copydir.  The example under copydir works with
+movedir too.  Just replace copydir with movedir in that
+example.  Comments under copydir.bat apply here too.  I
+mostly use movedir.bat myself instead of copydir.bat since
+its so much faster.
+
+8. show-svn-info.hta - Just run this from any Tortoise SVN folder
+and it will display some information about it.  Requires version 1.5
+or higher of Tortoise SVN.
+
+9. find-miktex.hta - displays the path to the MiKTeX bin directory.
+Just enter find-miktex.hta at the Windows command line (no arguments 
+are needed) or double click it from Windows Explorer.  
+
+DEPRECATED AND CHANGED
+
+- There was previously one perl program, toggleDoc.pl,
+  provided in the collection which is no longer distributed
+  but is still available with older distributions of
+  batchfiles.  It adds a "Show All" toggle box to the
+  00Index.html file of each package.
+
+
+- Rfind.bat, makepkg.bat and Rversions.bat are no longer
[TRUNCATED]

To get the complete diff run:
    svnlook diff /svnroot/sciviews -r 225


More information about the Sciviews-commits mailing list