[Sciviews-commits] r229 - in komodo/SciViews-K: . content/js defaults templates

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Tue Nov 17 12:18:17 CET 2009


Author: phgrosjean
Date: 2009-11-17 12:18:16 +0100 (Tue, 17 Nov 2009)
New Revision: 229

Added:
   komodo/SciViews-K/defaults/
   komodo/SciViews-K/defaults/.DS_Store
   komodo/SciViews-K/defaults/.Rprofile
   komodo/SciViews-K/defaults/ANNOUNCE
   komodo/SciViews-K/defaults/NEWS
   komodo/SciViews-K/defaults/R reference.kpz
   komodo/SciViews-K/defaults/R.bat
   komodo/SciViews-K/defaults/README
   komodo/SciViews-K/defaults/Rgui.bat
   komodo/SciViews-K/defaults/SciViews-K.kpz
   komodo/SciViews-K/defaults/print.help_files_with_topic.R
   komodo/SciViews-K/defaults/svGUI_0.9-46.tar.gz
   komodo/SciViews-K/defaults/svGUI_0.9-46.zip
   komodo/SciViews-K/defaults/svMisc_0.9-56.tar.gz
   komodo/SciViews-K/defaults/svMisc_0.9-56.zip
   komodo/SciViews-K/defaults/svSocket_0.9-48.tar.gz
   komodo/SciViews-K/defaults/svSocket_0.9-48.zip
   komodo/SciViews-K/defaults/svStart.R
   komodo/SciViews-K/sciviewsk-0.9.8-ko.xpi
Removed:
   komodo/SciViews-K/R/
   komodo/SciViews-K/koextlib_R.py
   komodo/SciViews-K/koextlib_include_R_dir.patch
   komodo/SciViews-K/templates/ANNOUNCE
   komodo/SciViews-K/templates/NEWS
   komodo/SciViews-K/templates/R reference.kpz
   komodo/SciViews-K/templates/R.bat
   komodo/SciViews-K/templates/README
   komodo/SciViews-K/templates/Rgui.bat
   komodo/SciViews-K/templates/SciViews-K.kpz
   komodo/SciViews-K/templates/print.help_files_with_topic.R
   komodo/SciViews-K/templates/svGUI_0.9-46.tar.gz
   komodo/SciViews-K/templates/svGUI_0.9-46.tgz
   komodo/SciViews-K/templates/svGUI_0.9-46.zip
   komodo/SciViews-K/templates/svIDE_0.9-47.tar.gz
   komodo/SciViews-K/templates/svIDE_0.9-47.tgz
   komodo/SciViews-K/templates/svIDE_0.9-47.zip
   komodo/SciViews-K/templates/svMisc_0.9-56.tar.gz
   komodo/SciViews-K/templates/svMisc_0.9-56.tgz
   komodo/SciViews-K/templates/svMisc_0.9-56.zip
   komodo/SciViews-K/templates/svSocket_0.9-48.tar.gz
   komodo/SciViews-K/templates/svSocket_0.9-48.tgz
   komodo/SciViews-K/templates/svSocket_0.9-48.zip
   komodo/SciViews-K/templates/svStart.R
Modified:
   komodo/SciViews-K/content/js/commands.js
   komodo/SciViews-K/content/js/r.js
   komodo/SciViews-K/templates/.DS_Store
Log:
All R starting files moved to /defaults subdirectory instead of /R (do not want to have to patch Komodo), plus some reworking of svStart() 

Modified: komodo/SciViews-K/content/js/commands.js
===================================================================
--- komodo/SciViews-K/content/js/commands.js	2009-11-13 21:47:01 UTC (rev 228)
+++ komodo/SciViews-K/content/js/commands.js	2009-11-17 11:18:16 UTC (rev 229)
@@ -90,26 +90,11 @@
 			"Rinitdir=" + sv.prefs.getString("sciviews.session.dir", "~"),
 			"koServe=" + sv.prefs.getString("sciviews.client.socket", "8888"),
 			"koPort=" + sv.prefs.getString("sciviews.server.socket", "7052"),
+			"koDebug=" + String(sv.socket.debug).toUpperCase(),
 			"koAppFile=" + sv.tools.file.path("binDir", "komodo" + (isWin? ".exe" : ""))
-		];
-
-		// Apply patch (koext_include_R_dir.patch) to <komodoInstallDir>/lib/sdk/pylib/koextlib.py,
-		// to make it include R directory in the .xpi
-		// otherwise the directory can be added manually.
-		
-		//Until we decide to keep R files in "R" or "templates"
-		if (sv.tools.file.exists(sv.tools.file.path(
-			"ProfD/extensions/sciviewsk at sciviews.org/R/.Rprofile"))) {
-			var cwd = sv.tools.file.path("ProfD", "extensions",
-				 "sciviewsk at sciviews.org", "R");
-		} else {
-			var cwd = sv.tools.file.path("ProfD", "extensions",
-				 "sciviewsk at sciviews.org", "templates");
-		}
-
-		// with:
-		//var cwd = sv.tools.file.path("ProfD", "extensions", "sciviewsk at sciviews.org", "R");
-
+		];	
+		var cwd = sv.tools.file.path("ProfD", "extensions",
+			"sciviewsk at sciviews.org", "defaults");
 		var command, runIn = "no-console";
 
 		sv.cmdout.message(sv.translate("Starting R... please wait"), 10000, true);

Modified: komodo/SciViews-K/content/js/r.js
===================================================================
--- komodo/SciViews-K/content/js/r.js	2009-11-13 21:47:01 UTC (rev 228)
+++ komodo/SciViews-K/content/js/r.js	2009-11-17 11:18:16 UTC (rev 229)
@@ -1228,10 +1228,10 @@
 	// if R is running
 	if (saveOld) {
 		// Save .RData & .Rhistory in the the session directory and clean WS
-		// We need also to restore .required and .SciViewsReady variables
+		// We need also to restore .required variable
 		cmd = 'assignTemp(".required", .required)\nTempEnv()$.Last.sys()\n' +
 			'save.image()\nsavehistory()\nrm(list = ls())\n' +
-			'.required <- getTemp(".required")\n.SciViewsReady <- TRUE\n';
+			'.required <- getTemp(".required")\n';
 
 	} else {
 		// Clear workspace (hint, we don't clear hidden objects!)

Added: komodo/SciViews-K/defaults/.DS_Store
===================================================================
(Binary files differ)


Property changes on: komodo/SciViews-K/defaults/.DS_Store
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: komodo/SciViews-K/defaults/.Rprofile
===================================================================
--- komodo/SciViews-K/defaults/.Rprofile	                        (rev 0)
+++ komodo/SciViews-K/defaults/.Rprofile	2009-11-17 11:18:16 UTC (rev 229)
@@ -0,0 +1,6 @@
+# Avoid running this function recursively (R restarts sometimes in Linux)
+if (!exists("svStart", envir = .GlobalEnv, mode = "function")) {
+	source("svStart.R")
+	svStart()
+	rm(svStart)
+}
\ No newline at end of file

Added: komodo/SciViews-K/defaults/ANNOUNCE
===================================================================
--- komodo/SciViews-K/defaults/ANNOUNCE	                        (rev 0)
+++ komodo/SciViews-K/defaults/ANNOUNCE	2009-11-17 11:18:16 UTC (rev 229)
@@ -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
+


Property changes on: komodo/SciViews-K/defaults/ANNOUNCE
___________________________________________________________________
Name: svn:executable
   + *

Added: komodo/SciViews-K/defaults/NEWS
===================================================================
--- komodo/SciViews-K/defaults/NEWS	                        (rev 0)
+++ komodo/SciViews-K/defaults/NEWS	2009-11-17 11:18:16 UTC (rev 229)
@@ -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.
+


Property changes on: komodo/SciViews-K/defaults/NEWS
___________________________________________________________________
Name: svn:executable
   + *

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


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

Added: komodo/SciViews-K/defaults/R.bat
===================================================================
--- komodo/SciViews-K/defaults/R.bat	                        (rev 0)
+++ komodo/SciViews-K/defaults/R.bat	2009-11-17 11:18:16 UTC (rev 229)
@@ -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


Property changes on: komodo/SciViews-K/defaults/R.bat
___________________________________________________________________
Name: svn:executable
   + *

Added: komodo/SciViews-K/defaults/README
===================================================================
--- komodo/SciViews-K/defaults/README	                        (rev 0)
+++ komodo/SciViews-K/defaults/README	2009-11-17 11:18:16 UTC (rev 229)
@@ -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:
[TRUNCATED]

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


More information about the Sciviews-commits mailing list