[Sciviews-commits] r44 - in komodo/SciViews-K: . R content/js templates
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Sun Jul 6 15:28:05 CEST 2008
Author: phgrosjean
Date: 2008-07-06 15:28:04 +0200 (Sun, 06 Jul 2008)
New Revision: 44
Added:
komodo/SciViews-K/R/#Rscript.bat
komodo/SciViews-K/R/ANNOUNCE
komodo/SciViews-K/R/COPYING
komodo/SciViews-K/R/COPYRIGHTS
komodo/SciViews-K/R/NEWS
komodo/SciViews-K/R/R.bat
komodo/SciViews-K/R/README
komodo/SciViews-K/R/RESOURCES
komodo/SciViews-K/R/Rcmd.bat
komodo/SciViews-K/R/Rgui.bat
komodo/SciViews-K/R/RguiStart.bat
komodo/SciViews-K/R/Rjgr.bat
komodo/SciViews-K/R/Rscript.bat
komodo/SciViews-K/R/Rtidy.bat
komodo/SciViews-K/R/Rtools.bat
komodo/SciViews-K/R/Rversions.bat
komodo/SciViews-K/R/Rversions.hta
komodo/SciViews-K/R/Stangle.bat
komodo/SciViews-K/R/Sweave.bat
komodo/SciViews-K/R/THANKS
komodo/SciViews-K/R/WISHLIST
komodo/SciViews-K/R/copydir.bat
komodo/SciViews-K/R/el.js
komodo/SciViews-K/R/jgr.bat
komodo/SciViews-K/R/movedir.bat
komodo/SciViews-K/R/rterm.bat
komodo/SciViews-K/sciviewsk-0.6.3-ko.xpi
komodo/SciViews-K/templates/.Rprofile
komodo/SciViews-K/templates/R.bat
komodo/SciViews-K/templates/Rgui.bat
komodo/SciViews-K/templates/SciViews-K 0.6.3.kpz
Removed:
komodo/SciViews-K/sciviewsk-0.6.1-ko.xpi
komodo/SciViews-K/sciviewsk-0.6.2-ko.xpi
Modified:
komodo/SciViews-K/chrome.manifest
komodo/SciViews-K/content/js/r.js
komodo/SciViews-K/install.rdf
komodo/SciViews-K/templates/.DS_Store
Log:
SciViews-K with batchfiles 0.4-3
Added: komodo/SciViews-K/R/#Rscript.bat
===================================================================
--- komodo/SciViews-K/R/#Rscript.bat (rev 0)
+++ komodo/SciViews-K/R/#Rscript.bat 2008-07-06 13:28:04 UTC (rev 44)
@@ -0,0 +1,108 @@
+
+ at echo off
+
+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.
+
+:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:: 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 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 defined R_TOOLS (
+ PATH %R_TOOLS%\bin;%R_TOOLS%\perl\bin;%R_TOOLS%\MinGW\bin;%PATH%
+)
+
+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=%path%) && 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 %cmd%==jgr.exe (
+ set st=start
+ set cmdpath=jgr.exe
+ for /f "delims=" %%i in (JGR) do set jgrpkg=%%~$R_LIBS:i
+ if defined jgrpkg set cmdpath=%jgrpkg%\jgr.exe
+ if exist "%R_HOME%\library\JGR\jgr.exe" set cmdpath=%R_HOME%\library\JGR\jgr.exe
+)
+
+if defined st (start "" "%cmdpath%" %args%) else "%cmdpath%" %args%
+goto:eof
+
+
+endlocal
Property changes on: komodo/SciViews-K/R/#Rscript.bat
___________________________________________________________________
Name: svn:executable
+ *
Added: komodo/SciViews-K/R/ANNOUNCE
===================================================================
--- komodo/SciViews-K/R/ANNOUNCE (rev 0)
+++ komodo/SciViews-K/R/ANNOUNCE 2008-07-06 13:28:04 UTC (rev 44)
@@ -0,0 +1,61 @@
+
+New Vesion of Windows Batchfiles for R
+
+batchfiles 0.4-2 consists of a set of Windows .bat utilities and other
+scripts that run R and associated programs by finding R in the
+registry so that no paths need be set -- a major source of error
+during installation. Also it implies that paths which might otherwise
+need to be updated when you upgrade R do not need to be. The tools
+automatically find the new registry entry.
+
+The utilities are Windows batch files or javascript files without
+dependencies. Just place those you want or all of them anywhere in
+your path and they instantly become available to Windows console
+sessions. No setting of paths or other formal installation is
+required.
+
+This version of batchfiles has only been tested on Windows Vista but
+most of the utilities may work on earlier versions as well. Version
+0.3-2 was only tested on Windows XP.
+
+NEW
+
+1. Stangle.bat
+
+A new command Stangle.bat is now available that is similar to
+Sweave.bat except it runs Stangle. Like Sweave.bat, it can be run
+without arguments to get help. Sweave.bat and Stangle.bat are
+actually the same file. Each queries the name by which it was called
+in order to determine what to do. Like Sweave.bat, Stangle.bat does
+not depend on rtools.
+
+2. rbatchfilesrc.bat
+
+For those situations where use of the registry is not desirable the
+batchfiles have supported certain environment variables that can be
+set in its place. New to this version is an optional second facility
+for those situations where the registry is not used. As with the
+setting of environment variables it can be used to override the
+registry values and heuristics or it can be used to have different
+versions of R automatically used by different projects.
+
+For this new second facility the user can place rbatchfilesrc.bat in
+the current directory or %userprofile% directory or the same directory
+as the batchfiles and the various batchfiles will get their
+definitions from that file instead of looking in the registry. A
+typical rbatchfilesrc.bat might be 3 lines long and look like this:
+
+ set R_HOME=C:\Program Files\R\R-2.7.0
+ set R_TOOLS=C:\Rtools
+ set R_MIKTEX=C:\Program Files\MiKTeX 2.7\miktex\bin
+
+Most people will not need this facility and will instead use the
+automatic registry lookup which completely avoids the need to specify
+path names but for situations as described this facility may be of
+use.
+
+The batchfiles are available on CRAN in the contributed extras area.
+For more information see the batchfiles home page at:
+
+ http://batchfiles.googlecode.com
+
Property changes on: komodo/SciViews-K/R/ANNOUNCE
___________________________________________________________________
Name: svn:executable
+ *
Added: komodo/SciViews-K/R/COPYING
===================================================================
--- komodo/SciViews-K/R/COPYING (rev 0)
+++ komodo/SciViews-K/R/COPYING 2008-07-06 13:28:04 UTC (rev 44)
@@ -0,0 +1,340 @@
+ GNU GENERAL PUBLIC LICENSE
+ Version 2, June 1991
+
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.
+ 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+ Preamble
+
+ The licenses for most software are designed to take away your
+freedom to share and change it. By contrast, the GNU General Public
+License is intended to guarantee your freedom to share and change free
+software--to make sure the software is free for all its users. This
+General Public License applies to most of the Free Software
+Foundation's software and to any other program whose authors commit to
+using it. (Some other Free Software Foundation software is covered by
+the GNU Library General Public License instead.) You can apply it to
+your programs, too.
+
+ When we speak of free software, we are referring to freedom, not
+price. Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+this service if you wish), that you receive source code or can get it
+if you want it, that you can change the software or use pieces of it
+in new free programs; and that you know you can do these things.
+
+ To protect your rights, we need to make restrictions that forbid
+anyone to deny you these rights or to ask you to surrender the rights.
+These restrictions translate to certain responsibilities for you if you
+distribute copies of the software, or if you modify it.
+
+ For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must give the recipients all the rights that
+you have. You must make sure that they, too, receive or can get the
+source code. And you must show them these terms so they know their
+rights.
+
+ We protect your rights with two steps: (1) copyright the software, and
+(2) offer you this license which gives you legal permission to copy,
+distribute and/or modify the software.
+
+ Also, for each author's protection and ours, we want to make certain
+that everyone understands that there is no warranty for this free
+software. If the software is modified by someone else and passed on, we
+want its recipients to know that what they have is not the original, so
+that any problems introduced by others will not reflect on the original
+authors' reputations.
+
+ Finally, any free program is threatened constantly by software
+patents. We wish to avoid the danger that redistributors of a free
+program will individually obtain patent licenses, in effect making the
+program proprietary. To prevent this, we have made it clear that any
+patent must be licensed for everyone's free use or not licensed at all.
+
+ The precise terms and conditions for copying, distribution and
+modification follow.
+
+ GNU GENERAL PUBLIC LICENSE
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+ 0. This License applies to any program or other work which contains
+a notice placed by the copyright holder saying it may be distributed
+under the terms of this General Public License. The "Program", below,
+refers to any such program or work, and a "work based on the Program"
+means either the Program or any derivative work under copyright law:
+that is to say, a work containing the Program or a portion of it,
+either verbatim or with modifications and/or translated into another
+language. (Hereinafter, translation is included without limitation in
+the term "modification".) Each licensee is addressed as "you".
+
+Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope. The act of
+running the Program is not restricted, and the output from the Program
+is covered only if its contents constitute a work based on the
+Program (independent of having been made by running the Program).
+Whether that is true depends on what the Program does.
+
+ 1. You may copy and distribute verbatim copies of the Program's
+source code as you receive it, in any medium, provided that you
+conspicuously and appropriately publish on each copy an appropriate
+copyright notice and disclaimer of warranty; keep intact all the
+notices that refer to this License and to the absence of any warranty;
+and give any other recipients of the Program a copy of this License
+along with the Program.
+
+You may charge a fee for the physical act of transferring a copy, and
+you may at your option offer warranty protection in exchange for a fee.
+
+ 2. You may modify your copy or copies of the Program or any portion
+of it, thus forming a work based on the Program, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+ a) You must cause the modified files to carry prominent notices
+ stating that you changed the files and the date of any change.
+
+ b) You must cause any work that you distribute or publish, that in
+ whole or in part contains or is derived from the Program or any
+ part thereof, to be licensed as a whole at no charge to all third
+ parties under the terms of this License.
+
+ c) If the modified program normally reads commands interactively
+ when run, you must cause it, when started running for such
+ interactive use in the most ordinary way, to print or display an
+ announcement including an appropriate copyright notice and a
+ notice that there is no warranty (or else, saying that you provide
+ a warranty) and that users may redistribute the program under
+ these conditions, and telling the user how to view a copy of this
+ License. (Exception: if the Program itself is interactive but
+ does not normally print such an announcement, your work based on
+ the Program is not required to print an announcement.)
+
+These requirements apply to the modified work as a whole. If
+identifiable sections of that work are not derived from the Program,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works. But when you
+distribute the same sections as part of a whole which is a work based
+on the Program, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Program.
+
+In addition, mere aggregation of another work not based on the Program
+with the Program (or with a work based on the Program) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+ 3. You may copy and distribute the Program (or a work based on it,
+under Section 2) in object code or executable form under the terms of
+Sections 1 and 2 above provided that you also do one of the following:
+
+ a) Accompany it with the complete corresponding machine-readable
+ source code, which must be distributed under the terms of Sections
+ 1 and 2 above on a medium customarily used for software interchange; or,
+
+ b) Accompany it with a written offer, valid for at least three
+ years, to give any third party, for a charge no more than your
+ cost of physically performing source distribution, a complete
+ machine-readable copy of the corresponding source code, to be
+ distributed under the terms of Sections 1 and 2 above on a medium
+ customarily used for software interchange; or,
+
+ c) Accompany it with the information you received as to the offer
+ to distribute corresponding source code. (This alternative is
+ allowed only for noncommercial distribution and only if you
+ received the program in object code or executable form with such
+ an offer, in accord with Subsection b above.)
+
+The source code for a work means the preferred form of the work for
+making modifications to it. For an executable work, complete source
+code means all the source code for all modules it contains, plus any
+associated interface definition files, plus the scripts used to
+control compilation and installation of the executable. However, as a
+special exception, the source code distributed need not include
+anything that is normally distributed (in either source or binary
+form) with the major components (compiler, kernel, and so on) of the
+operating system on which the executable runs, unless that component
+itself accompanies the executable.
+
+If distribution of executable or object code is made by offering
+access to copy from a designated place, then offering equivalent
+access to copy the source code from the same place counts as
+distribution of the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+ 4. You may not copy, modify, sublicense, or distribute the Program
+except as expressly provided under this License. Any attempt
+otherwise to copy, modify, sublicense or distribute the Program is
+void, and will automatically terminate your rights under this License.
+However, parties who have received copies, or rights, from you under
+this License will not have their licenses terminated so long as such
+parties remain in full compliance.
+
+ 5. You are not required to accept this License, since you have not
+signed it. However, nothing else grants you permission to modify or
+distribute the Program or its derivative works. These actions are
+prohibited by law if you do not accept this License. Therefore, by
+modifying or distributing the Program (or any work based on the
+Program), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Program or works based on it.
+
+ 6. Each time you redistribute the Program (or any work based on the
+Program), the recipient automatically receives a license from the
+original licensor to copy, distribute or modify the Program subject to
+these terms and conditions. You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties to
+this License.
+
+ 7. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Program at all. For example, if a patent
+license would not permit royalty-free redistribution of the Program by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Program.
+
+If any portion of this section is held invalid or unenforceable under
+any particular circumstance, the balance of the section is intended to
+apply and the section as a whole is intended to apply in other
+circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system, which is
+implemented by public license practices. Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+ 8. If the distribution and/or use of the Program is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Program under this License
+may add an explicit geographical distribution limitation excluding
+those countries, so that distribution is permitted only in or among
+countries not thus excluded. In such case, this License incorporates
+the limitation as if written in the body of this License.
+
+ 9. The Free Software Foundation may publish revised and/or new versions
+of the General Public License from time to time. Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+Each version is given a distinguishing version number. If the Program
+specifies a version number of this License which applies to it and "any
+later version", you have the option of following the terms and conditions
+either of that version or of any later version published by the Free
+Software Foundation. If the Program does not specify a version number of
+this License, you may choose any version ever published by the Free Software
+Foundation.
+
+ 10. If you wish to incorporate parts of the Program into other free
+programs whose distribution conditions are different, write to the author
+to ask for permission. For software which is copyrighted by the Free
+Software Foundation, write to the Free Software Foundation; we sometimes
+make exceptions for this. Our decision will be guided by the two goals
+of preserving the free status of all derivatives of our free software and
+of promoting the sharing and reuse of software generally.
+
+ NO WARRANTY
+
+ 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
+FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
+OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
+PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
+TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
+PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
+REPAIR OR CORRECTION.
+
+ 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
+REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
+INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
+OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
+TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
+YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
+PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGES.
+
+ END OF TERMS AND CONDITIONS
+
+ How to Apply These Terms to Your New Programs
+
+ If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+ To do so, attach the following notices to the program. It is safest
+to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+ <one line to give the program's name and a brief idea of what it does.>
+ Copyright (C) <year> <name of author>
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+
+Also add information on how to contact you by electronic and paper mail.
+
+If the program is interactive, make it output a short notice like this
+when it starts in an interactive mode:
+
+ Gnomovision version 69, Copyright (C) year name of author
+ Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+ This is free software, and you are welcome to redistribute it
+ under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License. Of course, the commands you use may
+be called something other than `show w' and `show c'; they could even be
+mouse-clicks or menu items--whatever suits your program.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the program, if
+necessary. Here is a sample; alter the names:
+
+ Yoyodyne, Inc., hereby disclaims all copyright interest in the program
+ `Gnomovision' (which makes passes at compilers) written by James Hacker.
+
+ <signature of Ty Coon>, 1 April 1989
+ Ty Coon, President of Vice
+
+This General Public License does not permit incorporating your program into
+proprietary programs. If your program is a subroutine library, you may
+consider it more useful to permit linking proprietary applications with the
+library. If this is what you want to do, use the GNU Library General
+Public License instead of this License.
Property changes on: komodo/SciViews-K/R/COPYING
___________________________________________________________________
Name: svn:executable
+ *
Added: komodo/SciViews-K/R/COPYRIGHTS
===================================================================
--- komodo/SciViews-K/R/COPYRIGHTS (rev 0)
+++ komodo/SciViews-K/R/COPYRIGHTS 2008-07-06 13:28:04 UTC (rev 44)
@@ -0,0 +1,10 @@
+COPYRIGHT STATUS
+----------------
+
+This code is:
+
+ Copyright (C) 2005 Gabor Grothendieck
+
+All code is subject to the GNU General Public License, Version 2. See
+the file COPYING for the exact conditions under which you may
+redistribute it.
Property changes on: komodo/SciViews-K/R/COPYRIGHTS
___________________________________________________________________
Name: svn:executable
+ *
Added: komodo/SciViews-K/R/NEWS
===================================================================
--- komodo/SciViews-K/R/NEWS (rev 0)
+++ komodo/SciViews-K/R/NEWS 2008-07-06 13:28:04 UTC (rev 44)
@@ -0,0 +1,230 @@
+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/R/NEWS
___________________________________________________________________
Name: svn:executable
+ *
Added: komodo/SciViews-K/R/R.bat
===================================================================
--- komodo/SciViews-K/R/R.bat (rev 0)
+++ komodo/SciViews-K/R/R.bat 2008-07-06 13:28:04 UTC (rev 44)
@@ -0,0 +1,118 @@
+
+ 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 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 defined R_TOOLS (
+ PATH %R_TOOLS%\bin;%R_TOOLS%\perl\bin;%R_TOOLS%\MinGW\bin;%PATH%
+)
+
+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=%path%) && 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 %cmd%==jgr.exe (
+ set st=start
+ set cmdpath=jgr.exe
+ for /f "delims=" %%i in (JGR) do set jgrpkg=%%~$R_LIBS:i
+ if defined jgrpkg set cmdpath=%jgrpkg%\jgr.exe
+ if exist "%R_HOME%\library\JGR\jgr.exe" set cmdpath=%R_HOME%\library\JGR\jgr.exe
+)
+
+if defined st (start "" "%cmdpath%" %args%) else "%cmdpath%" %args%
+goto:eof
+
+
+endlocal
Property changes on: komodo/SciViews-K/R/R.bat
___________________________________________________________________
Name: svn:executable
+ *
Added: komodo/SciViews-K/R/README
===================================================================
--- komodo/SciViews-K/R/README (rev 0)
+++ komodo/SciViews-K/R/README 2008-07-06 13:28:04 UTC (rev 44)
@@ -0,0 +1,348 @@
+batchfiles contains batch and GUI files for installing and maintaing R.
+
+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
+6. Rversions.bat
+
+
+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).
+
+Another 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.
+
+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
+ distributed in the batchfiles collection but are still
+ available in version 0.2-3 of batchfiles if you want them.
+ It is unknown whether they work with Vista and recent
+ versions of R. (I have not used them in some time so am
+ no longer maintaining them.) If you used Rversions.bat
+ before you can still use Rversions.hta, the GUI version of
+ the program -- that one is still part of the collection.
+
+ADDITIONAL FILES
+
+1. RESOURCES - additional information on writing Windows XP
+batch files.
+
+2. COPYRIGHT and COPYING - this is free software subject to
+ the GPL license as described.
+
+3. THANKS - acknowledgments.
+
Property changes on: komodo/SciViews-K/R/README
___________________________________________________________________
Name: svn:executable
+ *
Added: komodo/SciViews-K/R/RESOURCES
===================================================================
--- komodo/SciViews-K/R/RESOURCES (rev 0)
+++ komodo/SciViews-K/R/RESOURCES 2008-07-06 13:28:04 UTC (rev 44)
@@ -0,0 +1,146 @@
+XP BATCH COMMAND RESOURCES
+
+This file contains R-specific resources for Windows XP batch file
+creation and also general resources for Windows XP batch file creation.
+
+A. MAKING A WINDOWS PACKAGE IN R
+--------------------------------
+
+Make sure that:
+
+- you have read:
+ "Writing R Extensions" manual
+ http://www.murdoch-sutherland.com/Rtools/
+
+- you have downloaded and installed the tools from
+ http://www.murdoch-sutherland.com/Rtools/tools.zip.
+
+- you have installed LaTeX (MiKTeX), perl, the Microsoft help
+ compiler, and (if the package contains C or Fortran source code) the
+ MinGW compilers, as described at
+ http://www.murdoch-sutherland.com/Rtools/.
+
+- read
+ http://www.murdoch-sutherland.com/Rtools/miktex.html
+
+- your path contains the tools, htmlhelp, and the bin directories for R,
+ LaTeX, Perl, and (if the package contains C or Fortran source code
+ to be compiled with MinGW) MinGW. The tools directory should be the
+ first item in the path. This link shows how to set your path:
+ http://www.computerhope.com/issues/ch000549.htm
+
+Assuming that the R installation is in \Program Files\R\R-x.y-z
+
+1. Assuming your source package tree is in \Rpkgs\mypackage
+ then at a Windows command prompt:
+
+ cd \Rpkgs
+ Rcmd INSTALL mypackage
+
+ which will install it to \Program Files\R\R-x.y-z\library\mypackage
+ Or if you want to install it to a separate library:
+
+ cd \Rpkgs
+ md library
+ Rcmd INSTALL -l library mypackage
+
+2. Now in R:
+
+ library(mypackage)
+ ... test it out ...
+
+ or if you installed it to a separate library:
+
+ library(mypackage, lib = "/Rpkgs/library")
+
+3. Once it seems reasonably OK, see whether it passes Rcmd check:
+
+ cd \Rpkgs
+ Rcmd check mypackage
+
+ and fix it up until it does.
+
+4. Now create versions for Unix and Windows that you can distribute:
+
+ cd \Rpkgs
+ Rcmd build mypackage
+ Rcmd build mypackage --binary
+
+5. If you want to submit it to CRAN then upload the .tar.gz
+ file that was created from the "Rcmd build mypackage"
+ command in #4 to ftp://cran.R-project.org/incoming .
+ I usually use FileZilla to do the upload.
+ http://filezilla.sourceforge.net/
+
+
+B. Some R Resources on making packages
+--------------------------------------
+
+John Fox provides a batch file for making packages:
+
+ http://tolstoy.newcastle.edu.au/R/help/04/11/6729.html
+
+Henrik Bengtsson provides a batch file for setting environment
+variables:
+
+ http://tolstoy.newcastle.edu.au/R/devel/04a/0594.html
+
+Information on building packages can be found in the Writing
+Extensions Manual. The following link is also useful although
+the enclosed batch files eliminate the need for some of the
+procedures discussed:
+
+ http://www.murdoch-sutherland.com/Rtools/
+
+Googling for
+
+ creating making R packages
+
+will find links to a number of privately written tutorials.
+(I have not reviewed these.)
+
+C. GENERAL RESOURCES ON WINDOWS BATCH FILE PROGRAMMMING
+-------------------------------------------------------
+
+The Windows command line commands will bring up help information
+that is particularly useful:
+
+ help set
+ help for
+ help if
+
+Here are some links on Windows batch file programmming.
+
+ ftp://garbo.uwasa.fi/pc/link/tscmd.zip - FAQ with many idioms
+
+ http://gearbox.maem.umr.edu/batch/f_w_util/ - Frank Westlake utilities
+
+ http://gearbox.maem.umr.edu/fwu/ - more Frank Westlake utilities
+
+ http://groups-beta.google.com/group/alt.msdos.batch.nt/msg/5a9587e871c27a75 - cmd bugs
+
+ http://groups-beta.google.com/group/alt.msdos.batch/msg/7b1d22945c89af75 - cmd help resources
+
+ http://msdn.microsoft.com/downloads/list/webdev.asp - Windows script downloads
+
+ http://thesystemguard.com/TheGuardBook/CCS-Int/ - info on batch commands
+
+ http://www.allenware.com/icsw/icswref.htm - info on batch commands
+
+ http://www.commandline.co.uk - Ritchie Lawrence cmd line utilities
+
+ http://www.cybermesa.com/~bstewart/ - Bill Stewarts scripting tools
+
+ http://www.fpschultze.de - FP Shcultzes batch tricks
+
+ http://www.microsoft.com/technet/community/columns/scripts - MS TechNet scripting
+
+ http://www.murdoch-sutherland.com/Rtools - R package building tools
+
+ http://www.paulsadowski.com/WSH/cmdutils.htm - Paul Sadowski batch info
+
+ http://www.ss64.com/nt/index.html - batch command reference
+
+ http://www.vlaurie.com/computers2/Articles/rundll32.htm - rundll for batch scripts
+
+
Property changes on: komodo/SciViews-K/R/RESOURCES
___________________________________________________________________
Name: svn:executable
+ *
Added: komodo/SciViews-K/R/Rcmd.bat
===================================================================
--- komodo/SciViews-K/R/Rcmd.bat (rev 0)
+++ komodo/SciViews-K/R/Rcmd.bat 2008-07-06 13:28:04 UTC (rev 44)
@@ -0,0 +1,118 @@
+
+ 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 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 defined R_TOOLS (
+ PATH %R_TOOLS%\bin;%R_TOOLS%\perl\bin;%R_TOOLS%\MinGW\bin;%PATH%
+)
+
+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=%path%) && 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 %cmd%==jgr.exe (
+ set st=start
+ set cmdpath=jgr.exe
+ for /f "delims=" %%i in (JGR) do set jgrpkg=%%~$R_LIBS:i
+ if defined jgrpkg set cmdpath=%jgrpkg%\jgr.exe
+ if exist "%R_HOME%\library\JGR\jgr.exe" set cmdpath=%R_HOME%\library\JGR\jgr.exe
+)
+
+if defined st (start "" "%cmdpath%" %args%) else "%cmdpath%" %args%
+goto:eof
+
+
+endlocal
Property changes on: komodo/SciViews-K/R/Rcmd.bat
___________________________________________________________________
Name: svn:executable
+ *
Added: komodo/SciViews-K/R/Rgui.bat
===================================================================
--- komodo/SciViews-K/R/Rgui.bat (rev 0)
+++ komodo/SciViews-K/R/Rgui.bat 2008-07-06 13:28:04 UTC (rev 44)
@@ -0,0 +1,118 @@
+
+ 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 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 defined R_TOOLS (
+ PATH %R_TOOLS%\bin;%R_TOOLS%\perl\bin;%R_TOOLS%\MinGW\bin;%PATH%
+)
+
+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=%path%) && 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 %cmd%==jgr.exe (
+ set st=start
+ set cmdpath=jgr.exe
+ for /f "delims=" %%i in (JGR) do set jgrpkg=%%~$R_LIBS:i
+ if defined jgrpkg set cmdpath=%jgrpkg%\jgr.exe
+ if exist "%R_HOME%\library\JGR\jgr.exe" set cmdpath=%R_HOME%\library\JGR\jgr.exe
+)
+
+if defined st (start "" "%cmdpath%" %args%) else "%cmdpath%" %args%
+goto:eof
+
+
+endlocal
Property changes on: komodo/SciViews-K/R/Rgui.bat
___________________________________________________________________
Name: svn:executable
+ *
Added: komodo/SciViews-K/R/RguiStart.bat
===================================================================
--- komodo/SciViews-K/R/RguiStart.bat (rev 0)
+++ komodo/SciViews-K/R/RguiStart.bat 2008-07-06 13:28:04 UTC (rev 44)
@@ -0,0 +1,118 @@
+
+ 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 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 defined R_TOOLS (
+ PATH %R_TOOLS%\bin;%R_TOOLS%\perl\bin;%R_TOOLS%\MinGW\bin;%PATH%
+)
+
+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=%path%) && 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 %cmd%==jgr.exe (
+ set st=start
+ set cmdpath=jgr.exe
+ for /f "delims=" %%i in (JGR) do set jgrpkg=%%~$R_LIBS:i
+ if defined jgrpkg set cmdpath=%jgrpkg%\jgr.exe
+ if exist "%R_HOME%\library\JGR\jgr.exe" set cmdpath=%R_HOME%\library\JGR\jgr.exe
+)
+
+if defined st (start "" "%cmdpath%" %args%) else "%cmdpath%" %args%
+goto:eof
+
+
+endlocal
Property changes on: komodo/SciViews-K/R/RguiStart.bat
___________________________________________________________________
Name: svn:executable
+ *
Added: komodo/SciViews-K/R/Rjgr.bat
===================================================================
--- komodo/SciViews-K/R/Rjgr.bat (rev 0)
+++ komodo/SciViews-K/R/Rjgr.bat 2008-07-06 13:28:04 UTC (rev 44)
@@ -0,0 +1,118 @@
+
+ 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 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 defined R_TOOLS (
+ PATH %R_TOOLS%\bin;%R_TOOLS%\perl\bin;%R_TOOLS%\MinGW\bin;%PATH%
+)
+
+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=%path%) && 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 %cmd%==jgr.exe (
+ set st=start
+ set cmdpath=jgr.exe
+ for /f "delims=" %%i in (JGR) do set jgrpkg=%%~$R_LIBS:i
+ if defined jgrpkg set cmdpath=%jgrpkg%\jgr.exe
+ if exist "%R_HOME%\library\JGR\jgr.exe" set cmdpath=%R_HOME%\library\JGR\jgr.exe
+)
+
+if defined st (start "" "%cmdpath%" %args%) else "%cmdpath%" %args%
+goto:eof
+
+
+endlocal
Property changes on: komodo/SciViews-K/R/Rjgr.bat
___________________________________________________________________
Name: svn:executable
+ *
Added: komodo/SciViews-K/R/Rscript.bat
===================================================================
--- komodo/SciViews-K/R/Rscript.bat (rev 0)
+++ komodo/SciViews-K/R/Rscript.bat 2008-07-06 13:28:04 UTC (rev 44)
@@ -0,0 +1,118 @@
+
+ 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 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 defined R_TOOLS (
+ PATH %R_TOOLS%\bin;%R_TOOLS%\perl\bin;%R_TOOLS%\MinGW\bin;%PATH%
+)
+
+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=%path%) && 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 %cmd%==jgr.exe (
+ set st=start
+ set cmdpath=jgr.exe
+ for /f "delims=" %%i in (JGR) do set jgrpkg=%%~$R_LIBS:i
+ if defined jgrpkg set cmdpath=%jgrpkg%\jgr.exe
+ if exist "%R_HOME%\library\JGR\jgr.exe" set cmdpath=%R_HOME%\library\JGR\jgr.exe
+)
+
+if defined st (start "" "%cmdpath%" %args%) else "%cmdpath%" %args%
+goto:eof
+
+
+endlocal
Property changes on: komodo/SciViews-K/R/Rscript.bat
___________________________________________________________________
Name: svn:executable
+ *
Added: komodo/SciViews-K/R/Rtidy.bat
===================================================================
--- komodo/SciViews-K/R/Rtidy.bat (rev 0)
+++ komodo/SciViews-K/R/Rtidy.bat 2008-07-06 13:28:04 UTC (rev 44)
@@ -0,0 +1,8 @@
+#Rscript %0.bat %*
+# usage: Rtidy sourcefile.R > sourcefile.Rtidy.R
+# based on 3.1 of R Extensions Manual
+options(keep.source = FALSE)
+source(commandArgs(TRUE))
+dump(ls(all = TRUE), file = stdout())
+q("no")
+
Property changes on: komodo/SciViews-K/R/Rtidy.bat
___________________________________________________________________
Name: svn:executable
+ *
Added: komodo/SciViews-K/R/Rtools.bat
===================================================================
--- komodo/SciViews-K/R/Rtools.bat (rev 0)
+++ komodo/SciViews-K/R/Rtools.bat 2008-07-06 13:28:04 UTC (rev 44)
@@ -0,0 +1,118 @@
+
+ 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 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 defined R_TOOLS (
+ PATH %R_TOOLS%\bin;%R_TOOLS%\perl\bin;%R_TOOLS%\MinGW\bin;%PATH%
+)
+
+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=%path%) && 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 %cmd%==jgr.exe (
+ set st=start
+ set cmdpath=jgr.exe
+ for /f "delims=" %%i in (JGR) do set jgrpkg=%%~$R_LIBS:i
+ if defined jgrpkg set cmdpath=%jgrpkg%\jgr.exe
+ if exist "%R_HOME%\library\JGR\jgr.exe" set cmdpath=%R_HOME%\library\JGR\jgr.exe
+)
+
+if defined st (start "" "%cmdpath%" %args%) else "%cmdpath%" %args%
+goto:eof
+
+
+endlocal
Property changes on: komodo/SciViews-K/R/Rtools.bat
___________________________________________________________________
Name: svn:executable
+ *
Added: komodo/SciViews-K/R/Rversions.bat
===================================================================
--- komodo/SciViews-K/R/Rversions.bat (rev 0)
+++ komodo/SciViews-K/R/Rversions.bat 2008-07-06 13:28:04 UTC (rev 44)
@@ -0,0 +1,32 @@
+
+ at echo off
+
+:: Without args this lists the R_HOME directory for each version of R
+:: on the system. If one of those directories is given as an argument
+:: then that version is set to the current version
+:: Note: Use Rfind.bat and look on R_HOME line to find current version of R.
+
+setlocal
+rem ver | findstr XP >NUL
+rem if errorlevel 1 echo Warning: This script has only been tested on Windows XP.
+
+:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:: 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 echo "Error: R not found" & goto:eof
+
+cd %R_HOME%
+cd ..
+
+if "%1"=="" (
+ for /d %%a in (*) do if exist %%a\bin\R.exe echo %%a
+) else %1\bin\RSetReg
+
+endlocal
Property changes on: komodo/SciViews-K/R/Rversions.bat
___________________________________________________________________
Name: svn:executable
+ *
Added: komodo/SciViews-K/R/Rversions.hta
===================================================================
--- komodo/SciViews-K/R/Rversions.hta (rev 0)
+++ komodo/SciViews-K/R/Rversions.hta 2008-07-06 13:28:04 UTC (rev 44)
@@ -0,0 +1,149 @@
+
+<html>
+<head>
+<STYLE TYPE="text/css">
+.highlight {background:#ff00ff}
+.text {color:#ff00ff}
+.both {color:white;background:black}
+</STYLE>
+</head>
+<body>
+<h1>Change R Version</h1>
+The drop down menu lists all R versions on the current system that
+were found. The current version, if any, is the one
+highlighted in purple and initially displayed.
+To change the current version, select
+the desired one and press Apply.
+<form name="RVersionForm">
+<select name="dropdown">
+<script type="text/jscript">
+
+function MSDOS(DOSCmd, Stream) {
+ var alines, sCmd, stemp, ofs, oWS, tempfile;
+ sCmd = "%comspec% /c \"" + DOSCmd + "\" " + Stream + "> ";
+ ofs = new ActiveXObject("Scripting.FileSystemObject");
+ stemp = ofs.GetTempName();
+ oWS = new ActiveXObject("Wscript.Shell");
+ stemp = oWS.Environment("PROCESS")("TEMP") + "\\" + stemp;
+ oWS.Run(sCmd + stemp, 0, true);
+ tempFile = ofs.OpenTextFile(stemp)
+ alines = tempFile.ReadAll().split(/\r*\n/);
+ tempFile.close()
+ ofs.DeleteFile(stemp);
+ // alines.length = alines.length - 1
+ return alines;
+}
+
+function SetRVersion(menu) {
+ menuo = menu.options[menu.selectedIndex];
+ // this worked on XP:
+ // WshShell.Run("\"" + menuo.value + "\\bin\\RSetReg.exe\"", 0);
+ WshShell.CurrentDirectory = menuo.value;
+ // execute at elevated privledge
+ // only tested on Vista
+ new ActiveXObject("Shell.Application").ShellExecute("bin\\RSetReg.exe", "", "", "runas");
+ alert("Current R Version Set to\n" + menuo.value);
+ close();
+}
+
+// Johan Känngård, http://dev.kanngard.net, wrote uunique() and contains()
+function uunique(a) {
+ tmp = new Array(0);
+ for(i=0;i<a.length;i++){
+ if(!contains(tmp, a[i])){
+ tmp.length+=1;
+ tmp[tmp.length-1]=a[i];
+ }
+ }
+ return tmp;
+}
+function contains(a, e) {
+ for(j=0;j<a.length;j++)if(a[j]==e)return true;
+ return false;
+}
+
+var fso, WshShell;
+var arr, cmd, fc, fields, File, Folder, i, key, parent, regrhome;
+var rhome, selected, ver;
+WshShell = new ActiveXObject("Wscript.Shell");
+fso = new ActiveXObject("Scripting.FileSystemObject");
+
+arr = new Array();
+
+// push main key value
+key = "HKLM\\software\\r-core\\r\\InstallPath";
+regrhome = WshShell.RegRead(key);
+arr.push(regrhome);
+
+// push current directory
+arr.push(WshShell.CurrentDirectory);
+
+// push R_HOME
+rhome = WshShell.Environment("PROCESS").item("R_HOME")
+if (rhome != "") arr.push(rhome)
+
+// push subkeys
+key = MSDOS("reg query hklm\\software\\r-core\\r /s", 1);
+// alert(key.join(";\n"));
+for(i in key) {
+ if (key[i].match("InstallPath"))
+ arr.push(key[i].split(/ /).slice(2).join(" "));
+}
+
+// sort and remove duplicates
+arr.sort();
+arr = uunique(arr);
+
+// push those that correspond to R directories
+arr2 = new Array();
+for(i in arr) {
+ arr[i].replace(/\\$/);
+ if (fso.FileExists(arr[i] + "\\" + "bin\\Rcmd.exe"))
+ arr2.push(arr[i]);
+}
+
+// push on sibs that correspond to R directories
+n = arr2.length;
+for(i = 0; i < n; i++) {
+ parent = fso.GetParentFolderName(arr2[i]);
+ lastdir = parent.replace(/.*\\/, "");
+ if (lastdir == "R") {
+ Folder = fso.GetFolder(parent);
+ fc = new Enumerator(Folder.SubFolders);
+ for (;!fc.atEnd(); fc.moveNext()) {
+ File = fc.item();
+ WshShell.CurrentDirectory = File.Path;
+ if (!contains(arr2, File.Path) &&
+ fso.FileExists("bin\\R.exe"))
+ arr2.push(File.Path);
+ }
+ }
+}
+
+// entries to arr2 are a single string with three \n-separated fields:
+// version, path, selected status
+for(i in arr2) {
+ selected = "";
+ if (arr2[i] == regrhome) {
+ selected = "selected=selected class=highlight";
+ }
+ WshShell.CurrentDirectory = arr2[i];
+ cmd = "bin\\R.exe --version";
+ ver = MSDOS(cmd, 2)[0];
+ arr2[i] = ver + "\n" + arr2[i] + "\n" + selected;
+}
+
+
+arr2.sort().reverse();
+for(i in arr2) {
+ fields = arr2[i].split("\n");
+ document.write("<option " + fields[2] + " value=\"" + fields[1] + "\">" + fields[0] + " - " + fields[1] + "</option>");
+}
+</script>
+</select>
+<input type="button" name="Submit" value="Apply" onClick="javascript:SetRVersion(document.RVersionForm.dropdown)">
+<input type="button" name="Cancel" value="Cancel" onClick="javascript:window.close()">
+</form>
+
+</body>
+</html>
Property changes on: komodo/SciViews-K/R/Rversions.hta
___________________________________________________________________
Name: svn:executable
+ *
Added: komodo/SciViews-K/R/Stangle.bat
===================================================================
--- komodo/SciViews-K/R/Stangle.bat (rev 0)
+++ komodo/SciViews-K/R/Stangle.bat 2008-07-06 13:28:04 UTC (rev 44)
@@ -0,0 +1,288 @@
+ at echo off
+setlocal
+rem rem ver | findstr XP >NUL
+
+for %%i in (%0) do set cmd=%%~ni
+if /i "%cmd%"=="Stangle" set cmd=Stangle
+if /i "%cmd%"=="Sweave" set cmd=Sweave
+
+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 (
+ set R_BATCHFILES_RC
+ if exist "%R_BATCHFILES_RC%" call %R_BATCHFILES_RC%
+)
+
+if "%1"=="" goto:help
+if "%1"=="-h" goto:help
+if "%1"=="--help" goto:help
+if "%1"=="/?" goto:help
+if "%1"==":Rterm" (
+
+ 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 echo "Error: R not found" & goto:eof
+
+ set here=%CD%
+ set args=%2 %3 %4 %5 %6 %7 %8 %9
+
+ set cmd=:Rterm
+
+ goto:Rterm
+)
+goto:continue
+:help
+echo Usage: %0 abc.Rnw
+echo or %0 abc
+if /i "%cmd%"=="stangle" goto:eof
+echo switches:
+echo -t or --tex or produce tex file and exit
+echo -p or --pdf or produce pdf file and exit
+echo -n or --nobck.pdf do not create .bck.pdf; instead display pdf directly
+echo Runs sweave producing a .tex file. Then it runs pdflatex producing
+echo a .pdf file and a .bck.pdf file. Finally the .bck.pdf file is
+echo displayed on screen.
+echo.
+echo Examples:
+echo.
+echo 1. Run sweave, pdflatex, create backup pdf with unique name, display it
+echo sweave mydoc.Rnw
+echo 2. Same
+echo sweave mydoc
+echo 3. Run sweave to create tex file. Do not run pdflatex or display.
+echo sweave mydoc --tex
+echo 4. Run sweave and pdflatex creating pdf file. Do not create .bck.pdf
+echo file and do not display file.
+echo sweave mydoc --pdf
+echo 5. Run sweave and pdflatex. Do not create .bck.pdf. Display .pdf file.
+echo sweave mydoc --nobck
+goto:eof
+:continue
+
+:: argument processing
+:: - returns 'file' as file argument and 'switch' as switch argument
+
+ :loop
+ (set arg=%~1)
+ shift
+ if not defined arg goto :cont
+ (set prefix1=%arg:~0,1%)
+ if "%prefix1%"=="-" goto:switch
+ set file=%arg%
+ goto:loop
+ :switch
+ :: remove dashes from switch and get first char
+ set switch=%arg:-=%
+ set switch=%switch:~0,1%
+ goto:loop
+ :cont
+
+if errorlevel 1 echo Warning: This script has only been tested on Windows XP.
+if exist "%file%.Rtex" set infile="%file%.Rtex"
+if exist "%file%.Snw" set infile="%file%.Snw"
+if exist "%file%.Rnw" set infile="%file%.Rnw"
+if exist "%file%" set infile="%file%"
+set infilslsh=%infile:\=/%
+:: call sweave
+echo library('utils'); %cmd%(%infilslsh%) | %cmd%.bat :Rterm --no-restore --slave
+if /i "%cmd%"=="stangle" goto:eof
+:: echo on
+if errorlevel 1 goto:eof
+if /i "%switch%"=="t" goto:eof
+
+:: echo %cd%
+for %%a in ("%file%") do set base=%%~sdpna
+if not exist "%base%.tex" goto:eof
+for /f "delims=" %%a in ('dir %infile% "%base%.tex" /od/b ^| more +1'
+) do set ext=%%~xa
+
+:: 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 "%ext%"==".tex" (pdflatex "%base%.tex") else goto:eof
+if errorlevel 1 goto:eof
+if /i "%switch%"=="p" goto:eof
+
+if not exist "%base%.pdf" goto:eof
+for /f "delims=" %%a in ('dir "%base%.pdf" "%base%.tex" /od/b ^| more +1'
+) do set ext=%%~xa
+if not "%ext%"==".pdf" goto:eof
+set pdffile=%base%.pdf
+if /i "%switch%"=="n" start "" "%pdffile%" && goto:eof
+set tmpfile=%date%-%time%
+set tmpfile=%tmpfile: =-%
+set tmpfile=%tmpfile::=.%
+set tmpfile=%tmpfile:/=.%
+set tmpfile=%base%-%tmpfile%.bck.pdf
+copy "%pdffile%" "%tmpfile%"
+start "" "%tmpfile%"
+echo *** delete *.bck.pdf files when done ***
+goto:eof
+
+
+
+ at echo off
+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
+:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+
+:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:: 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 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 defined R_TOOLS (
+ PATH %R_TOOLS%\bin;%R_TOOLS%\perl\bin;%R_TOOLS%\MinGW\bin;%PATH%
+)
+
+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
+
+goto %cmd%
+goto:eof
+
+:: note that RguiStart sets cmd to rgui.exe and then
+:: jumps to :Rgui.exe where processing is finished
+:RguiStart
+:RguiStart.exe
+cd %R_HOME%\bin
+if /i not %cmd%==rguistart.exe goto:Rgui
+ 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
+ )
+
+:Rcmd2
+:Rcmd2.exe
+:Rcmd
+:Rcmd.exe
+(set cmd=rcmd.exe)&goto:main
+
+:Rterm
+:Rterm.exe
+(set cmd=rterm.exe)&goto:main
+
+:Rgui
+:Rgui.exe
+(set cmd=rgui.exe)&goto:main
+
+:R
+:R.exe
+(set cmd=r)&goto:main
+
+:Rjgr
+:Rjgr.exe
+(set cmd=rjgr)&goto:main
+
+:#Rscript
+:#Rscript.exe
+:Rscript
+:Rscript.exe
+(set cmd=rscript.exe)&goto:main
+
+# main portion of program
+:main
+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 %cmd%==jgr.exe (
+ set st=start
+ set cmdpath=jgr.exe
+ for /f "delims=" %%i in (JGR) do set jgrpkg=%%~$R_LIBS:i
+ if defined jgrpkg set cmdpath=%jgrpkg%\jgr.exe
+ if exist "%R_HOME%\library\JGR\jgr.exe" set cmdpath=%R_HOME%\library\JGR\jgr.exe
+)
+
+if defined st (start "" "%cmdpath%" %args%) else "%cmdpath%" %args%
+goto:eof
+
+endlocal
+
+
+endlocal
+
+
+
Property changes on: komodo/SciViews-K/R/Stangle.bat
___________________________________________________________________
Name: svn:executable
+ *
Added: komodo/SciViews-K/R/Sweave.bat
===================================================================
--- komodo/SciViews-K/R/Sweave.bat (rev 0)
+++ komodo/SciViews-K/R/Sweave.bat 2008-07-06 13:28:04 UTC (rev 44)
@@ -0,0 +1,288 @@
+ at echo off
+setlocal
+rem rem ver | findstr XP >NUL
+
+for %%i in (%0) do set cmd=%%~ni
+if /i "%cmd%"=="Stangle" set cmd=Stangle
+if /i "%cmd%"=="Sweave" set cmd=Sweave
+
+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 (
+ set R_BATCHFILES_RC
+ if exist "%R_BATCHFILES_RC%" call %R_BATCHFILES_RC%
+)
+
+if "%1"=="" goto:help
+if "%1"=="-h" goto:help
+if "%1"=="--help" goto:help
+if "%1"=="/?" goto:help
+if "%1"==":Rterm" (
+
+ 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 echo "Error: R not found" & goto:eof
+
+ set here=%CD%
+ set args=%2 %3 %4 %5 %6 %7 %8 %9
+
+ set cmd=:Rterm
+
+ goto:Rterm
+)
+goto:continue
+:help
+echo Usage: %0 abc.Rnw
+echo or %0 abc
+if /i "%cmd%"=="stangle" goto:eof
+echo switches:
+echo -t or --tex or produce tex file and exit
+echo -p or --pdf or produce pdf file and exit
+echo -n or --nobck.pdf do not create .bck.pdf; instead display pdf directly
+echo Runs sweave producing a .tex file. Then it runs pdflatex producing
+echo a .pdf file and a .bck.pdf file. Finally the .bck.pdf file is
+echo displayed on screen.
+echo.
+echo Examples:
+echo.
+echo 1. Run sweave, pdflatex, create backup pdf with unique name, display it
+echo sweave mydoc.Rnw
+echo 2. Same
+echo sweave mydoc
+echo 3. Run sweave to create tex file. Do not run pdflatex or display.
+echo sweave mydoc --tex
+echo 4. Run sweave and pdflatex creating pdf file. Do not create .bck.pdf
+echo file and do not display file.
+echo sweave mydoc --pdf
+echo 5. Run sweave and pdflatex. Do not create .bck.pdf. Display .pdf file.
+echo sweave mydoc --nobck
+goto:eof
+:continue
+
+:: argument processing
+:: - returns 'file' as file argument and 'switch' as switch argument
+
+ :loop
+ (set arg=%~1)
+ shift
+ if not defined arg goto :cont
+ (set prefix1=%arg:~0,1%)
+ if "%prefix1%"=="-" goto:switch
+ set file=%arg%
+ goto:loop
+ :switch
+ :: remove dashes from switch and get first char
+ set switch=%arg:-=%
+ set switch=%switch:~0,1%
+ goto:loop
+ :cont
+
+if errorlevel 1 echo Warning: This script has only been tested on Windows XP.
+if exist "%file%.Rtex" set infile="%file%.Rtex"
+if exist "%file%.Snw" set infile="%file%.Snw"
+if exist "%file%.Rnw" set infile="%file%.Rnw"
+if exist "%file%" set infile="%file%"
+set infilslsh=%infile:\=/%
+:: call sweave
+echo library('utils'); %cmd%(%infilslsh%) | %cmd%.bat :Rterm --no-restore --slave
+if /i "%cmd%"=="stangle" goto:eof
+:: echo on
+if errorlevel 1 goto:eof
+if /i "%switch%"=="t" goto:eof
+
+:: echo %cd%
+for %%a in ("%file%") do set base=%%~sdpna
+if not exist "%base%.tex" goto:eof
+for /f "delims=" %%a in ('dir %infile% "%base%.tex" /od/b ^| more +1'
+) do set ext=%%~xa
+
+:: 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 "%ext%"==".tex" (pdflatex "%base%.tex") else goto:eof
+if errorlevel 1 goto:eof
+if /i "%switch%"=="p" goto:eof
+
+if not exist "%base%.pdf" goto:eof
+for /f "delims=" %%a in ('dir "%base%.pdf" "%base%.tex" /od/b ^| more +1'
+) do set ext=%%~xa
+if not "%ext%"==".pdf" goto:eof
+set pdffile=%base%.pdf
+if /i "%switch%"=="n" start "" "%pdffile%" && goto:eof
+set tmpfile=%date%-%time%
+set tmpfile=%tmpfile: =-%
+set tmpfile=%tmpfile::=.%
+set tmpfile=%tmpfile:/=.%
+set tmpfile=%base%-%tmpfile%.bck.pdf
+copy "%pdffile%" "%tmpfile%"
+start "" "%tmpfile%"
+echo *** delete *.bck.pdf files when done ***
+goto:eof
+
+
+
+ at echo off
+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
+:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+
+:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:: 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 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 defined R_TOOLS (
+ PATH %R_TOOLS%\bin;%R_TOOLS%\perl\bin;%R_TOOLS%\MinGW\bin;%PATH%
+)
+
+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
+
+goto %cmd%
+goto:eof
+
+:: note that RguiStart sets cmd to rgui.exe and then
+:: jumps to :Rgui.exe where processing is finished
+:RguiStart
+:RguiStart.exe
+cd %R_HOME%\bin
+if /i not %cmd%==rguistart.exe goto:Rgui
+ 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
+ )
+
+:Rcmd2
+:Rcmd2.exe
+:Rcmd
+:Rcmd.exe
+(set cmd=rcmd.exe)&goto:main
+
+:Rterm
+:Rterm.exe
+(set cmd=rterm.exe)&goto:main
+
+:Rgui
+:Rgui.exe
+(set cmd=rgui.exe)&goto:main
+
+:R
+:R.exe
+(set cmd=r)&goto:main
+
+:Rjgr
+:Rjgr.exe
+(set cmd=rjgr)&goto:main
+
+:#Rscript
+:#Rscript.exe
+:Rscript
+:Rscript.exe
+(set cmd=rscript.exe)&goto:main
+
+# main portion of program
+:main
+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 %cmd%==jgr.exe (
+ set st=start
+ set cmdpath=jgr.exe
+ for /f "delims=" %%i in (JGR) do set jgrpkg=%%~$R_LIBS:i
+ if defined jgrpkg set cmdpath=%jgrpkg%\jgr.exe
+ if exist "%R_HOME%\library\JGR\jgr.exe" set cmdpath=%R_HOME%\library\JGR\jgr.exe
+)
+
+if defined st (start "" "%cmdpath%" %args%) else "%cmdpath%" %args%
+goto:eof
+
+endlocal
+
+
+endlocal
+
+
+
Property changes on: komodo/SciViews-K/R/Sweave.bat
___________________________________________________________________
Name: svn:executable
+ *
Added: komodo/SciViews-K/R/THANKS
===================================================================
--- komodo/SciViews-K/R/THANKS (rev 0)
+++ komodo/SciViews-K/R/THANKS 2008-07-06 13:28:04 UTC (rev 44)
@@ -0,0 +1,31 @@
+
+Thanks to the following for contributing code:
+
+ Dieter Menne <dieter.menne at menne-biomed.de>
+
+Thanks to the following for finding bugs:
+
+ Xiaohua Dai <ecoinformatics at gmail.com>
+
+Thanks to the following people for discussion related to R:
+
+ Henrik Bengtsson <henrikb at braju.com>
+ J. Hosking <jh910 at juno.com>
+ Uwe Ligges <ligges at statistik.uni-dortmund.de>
+ Duncan Murdoch <murdoch at stats.uwo.ca>
+ Tobias Verbeke <tobias.verbeke at telenet.be>
+
+Also thanks to the following for discussion related to Windows batch:
+
+ William Allen
+ billious
+ Clay Calvert
+ Ted Davis
+ Al Dunbar
+ foxidrive
+ Phil Robyn
+ Paul R. Sadowski
+ Timo Salmi
+ Matthias Tacke
+ Todd Vargo
+
Property changes on: komodo/SciViews-K/R/THANKS
___________________________________________________________________
Name: svn:executable
+ *
Added: komodo/SciViews-K/R/WISHLIST
===================================================================
--- komodo/SciViews-K/R/WISHLIST (rev 0)
+++ komodo/SciViews-K/R/WISHLIST 2008-07-06 13:28:04 UTC (rev 44)
@@ -0,0 +1,11 @@
+WISHLIST
+
+o Sweave.bat
+ - output file name
+ - commandArgs
+ - brew
+
+o clean up documentation
+
+o test latest version of XP (recent versions were tested only on Vista;
+ versions up to 0.3-2 tested only on XP)
Property changes on: komodo/SciViews-K/R/WISHLIST
___________________________________________________________________
Name: svn:executable
+ *
Added: komodo/SciViews-K/R/copydir.bat
===================================================================
--- komodo/SciViews-K/R/copydir.bat (rev 0)
+++ komodo/SciViews-K/R/copydir.bat 2008-07-06 13:28:04 UTC (rev 44)
@@ -0,0 +1,18 @@
+setlocal
+:: Usage:
+:: If arg1 and arg2 are the library subdirectories of two R distributions
+:: then all libraries in arg1 that are not already in arg2 are copied to
+:: arg2. Note that this is a fast way of upgrading to a new version of
+:: R but won't work if the versions of R have different library formats.
+:: I believe this will work for upgrading 2.x.x to a higher 2.x.x and
+:: I personally upgraded my 2.1.0 to 2.2.0 this way so it seems ok until
+:: R replaces this with something better which is expected for 2.3.0.
+:: Example:
+:: cd \Program Files\R
+:: copydir rw2011pat\library R-2.2.0\library
+::
+:: Notes on code:
+:: on xcopy command /e copies subdir/files incl empty ones
+:: on xcopy command /i causes target to be created
+for /D %%a in ("%~1\*") do if not exist %2\%%~na xcopy /e/i "%%a" "%~2\%%~nxa"
+endlocal
Property changes on: komodo/SciViews-K/R/copydir.bat
___________________________________________________________________
Name: svn:executable
+ *
Added: komodo/SciViews-K/R/el.js
===================================================================
--- komodo/SciViews-K/R/el.js (rev 0)
+++ komodo/SciViews-K/R/el.js 2008-07-06 13:28:04 UTC (rev 44)
@@ -0,0 +1,16 @@
+// elevate.js -- runs target command line elevated
+if (WScript.Arguments.Length >= 1) {
+ Application = WScript.Arguments(0);
+ Arguments = "";
+ for (Index = 1; Index < WScript.Arguments.Length; Index += 1) {
+ if (Index > 1) {
+ Arguments += " ";
+ }
+ Arguments += WScript.Arguments(Index);
+ }
+ new ActiveXObject("Shell.Application").ShellExecute(Application, Arguments, "", "runas");
+} else {
+ WScript.Echo("Usage:");
+ WScript.Echo("elevate Application Arguments");
+}
+
Property changes on: komodo/SciViews-K/R/el.js
___________________________________________________________________
Name: svn:executable
+ *
Added: komodo/SciViews-K/R/jgr.bat
===================================================================
--- komodo/SciViews-K/R/jgr.bat (rev 0)
+++ komodo/SciViews-K/R/jgr.bat 2008-07-06 13:28:04 UTC (rev 44)
@@ -0,0 +1,78 @@
+
+ at echo off
+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.
+
+:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:: 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 echo "Error: R not found" & goto:eof
+
+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
+
+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 %cmd%==jgr.exe (
+ set st=start
+ set cmdpath=jgr.exe
+ for /f "delims=" %%i in (JGR) do set jgrpkg=%%~$R_LIBS:i
+ if defined jgrpkg set cmdpath=%jgrpkg%\jgr.exe
+ if exist "%R_HOME%\library\JGR\jgr.exe" set cmdpath=%R_HOME%\library\JGR\jgr.exe
+)
+
+if defined st (start "" "%cmdpath%" %args%) else "%cmdpath%" %args%
+goto:eof
+
+
+endlocal
+
+
+
Property changes on: komodo/SciViews-K/R/jgr.bat
___________________________________________________________________
Name: svn:executable
+ *
Added: komodo/SciViews-K/R/movedir.bat
===================================================================
--- komodo/SciViews-K/R/movedir.bat (rev 0)
+++ komodo/SciViews-K/R/movedir.bat 2008-07-06 13:28:04 UTC (rev 44)
@@ -0,0 +1,12 @@
+setlocal
+:: Usage:
+:: If arg1 and arg2 are the library subdirectories of two R distributions
+:: then all libraries in arg1 that are not already in arg2 are moved to
+:: arg2. Note that this is a fast way of upgrading to a new version of
+:: R but won't work if the versions of R have different library formats.
+:: Example:
+:: cd \Program Files\R
+:: movedir R-2.2.0\library R-2.2.0pat\library
+::
+for /D %%a in ("%~1\*") do if not exist %2\%%~na move "%%a" "%~2\%%~nxa"
+endlocal
Property changes on: komodo/SciViews-K/R/movedir.bat
___________________________________________________________________
Name: svn:executable
+ *
Added: komodo/SciViews-K/R/rterm.bat
===================================================================
--- komodo/SciViews-K/R/rterm.bat (rev 0)
+++ komodo/SciViews-K/R/rterm.bat 2008-07-06 13:28:04 UTC (rev 44)
@@ -0,0 +1,118 @@
+
+ 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 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 defined R_TOOLS (
+ PATH %R_TOOLS%\bin;%R_TOOLS%\perl\bin;%R_TOOLS%\MinGW\bin;%PATH%
+)
+
+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=%path%) && 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 %cmd%==jgr.exe (
+ set st=start
+ set cmdpath=jgr.exe
+ for /f "delims=" %%i in (JGR) do set jgrpkg=%%~$R_LIBS:i
+ if defined jgrpkg set cmdpath=%jgrpkg%\jgr.exe
+ if exist "%R_HOME%\library\JGR\jgr.exe" set cmdpath=%R_HOME%\library\JGR\jgr.exe
+)
+
+if defined st (start "" "%cmdpath%" %args%) else "%cmdpath%" %args%
+goto:eof
+
+
+endlocal
Property changes on: komodo/SciViews-K/R/rterm.bat
___________________________________________________________________
Name: svn:executable
+ *
Modified: komodo/SciViews-K/chrome.manifest
===================================================================
--- komodo/SciViews-K/chrome.manifest 2008-07-06 13:07:40 UTC (rev 43)
+++ komodo/SciViews-K/chrome.manifest 2008-07-06 13:28:04 UTC (rev 44)
@@ -5,4 +5,4 @@
locale sciviewsk en-GB jar:sciviewsk.jar!/locale/en-GB/
locale sciviewsk fr-FR jar:sciviewsk.jar!/locale/fr-FR/
-skin sciviewsk classic/1.0 jar:sciviewsk.jar!/skin/
\ No newline at end of file
+skin sciviewsk classic/1.0 jar:sciviewsk.jar!/skin/
Modified: komodo/SciViews-K/content/js/r.js
===================================================================
--- komodo/SciViews-K/content/js/r.js 2008-07-06 13:07:40 UTC (rev 43)
+++ komodo/SciViews-K/content/js/r.js 2008-07-06 13:28:04 UTC (rev 44)
@@ -28,6 +28,9 @@
// sv.r.dataList(loaded); // List R datasets in "loaded" or "all" packages
// sv.r.data(); // Select one dataset to load
// sv.r.data_select(data); // Callback function for sv.r.data()
+// sv.r.saveGraph(type, file, title, height, width, method);
+// // Save the current R graph in different formats
+// sv.r.quit(save); // Quit R (ask to save in save in not defined)
//
// sv.r.pck namespace: /////////////////////////////////////////////////////////
// sv.r.pkg.repositories(); // Select repositories for installing R packages
@@ -61,6 +64,8 @@
sv.r.eval = function(cmd) {
// Store the current R command
if (sv.socket.prompt == ":> ") {
+ // Special case for q() and quit() => use sv.r.quit() instead
+ if (cmd == "q()" | cmd == "quit()") return(sv.r.quit());
// This is a new command
sv.socket.cmd = cmd;
} else {
@@ -444,7 +449,42 @@
return(res);
}
+// There is also dev.copy2pdf() copy2eps() + savePlot windows and X11(type = "Cairo")
+sv.r.saveGraph = function(type, file, title, height, width, method) {
+ if (typeof(type) == "undefined") { type = "png256"; }
+ // Get the file extension according to type
+ var ext = type.substring(0, 4);
+ if (ext != "pgnm" & ext != "tiff" & ext != "jpeg") { ext = ext.substring(0, 3); }
+ if (ext.substring(0, 2) == "ps") { ext = "ps"; }
+ if (ext == "jpeg") { ext = "jpg" }
+ if (typeof(height) == "undefined") { height = 'dev.size()[2]'; }
+ if (typeof(width) == "undefined") { width = 'dev.size()[1]'; }
+ if (typeof(method) == "undefined") { method = "pdf"; }
+ // Ask for the filename if not provided
+ if (typeof(file) == "undefined") {
+ if (typeof(title) == "undefined") { title = 'Save the graph as "' + type + '"'; }
+ file = ko.filepicker.saveFile("", "Rplot." + ext, title);
+ if (file == null) return; // User clicked cancel
+ }
+ // Save the current device in R using dev2bitmap()... needs gostscript!
+ sv.r.eval('dev2bitmap("' + file + '", type = "' + type + '", height = ' + height +
+ ', width = ' + width + ', method = "' + method + '")');
+}
+sv.r.quit = function(save) {
+ if (typeof(save) == "undefined") {
+ // Ask for saving or not
+ var response = ko.dialogs.customButtons("Do you want to save the workspace (.RData) " +
+ "and the command history (.Rhistory) in the current directory first?",
+ ["Yes", "No", "Cancel"], // buttons
+ "No", // default response
+ null, // text
+ "Exiting R"); // title
+ if (response == "Cancel") { return; }
+ }
+ sv.r.eval('q("' + response.toLowerCase() + '")');
+}
+
// Define the 'sv.r.pkg' namespace /////////////////////////////////////////////
if (typeof(sv.r.pkg) == 'undefined') sv.r.pkg = new Object();
Modified: komodo/SciViews-K/install.rdf
===================================================================
--- komodo/SciViews-K/install.rdf 2008-07-06 13:07:40 UTC (rev 43)
+++ komodo/SciViews-K/install.rdf 2008-07-06 13:28:04 UTC (rev 44)
@@ -41,7 +41,7 @@
<Description about="urn:mozilla:install-manifest">
<em:id>sciviewsk at sciviews.org</em:id>
<em:name>SciViews-K</em:name>
- <em:version>0.6.2</em:version>
+ <em:version>0.6.3</em:version>
<em:description>SciViews-K - Edit R (http://www.r-project.org) code in Komodo</em:description>
<em:creator>Philippe Grosjean and Romain Francois</em:creator>
<em:homepageURL>http://sciviews.org/SciViews-K</em:homepageURL>
Deleted: komodo/SciViews-K/sciviewsk-0.6.1-ko.xpi
===================================================================
(Binary files differ)
Deleted: komodo/SciViews-K/sciviewsk-0.6.2-ko.xpi
===================================================================
(Binary files differ)
Added: komodo/SciViews-K/sciviewsk-0.6.3-ko.xpi
===================================================================
(Binary files differ)
Property changes on: komodo/SciViews-K/sciviewsk-0.6.3-ko.xpi
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Modified: komodo/SciViews-K/templates/.DS_Store
===================================================================
(Binary files differ)
Added: komodo/SciViews-K/templates/.Rprofile
===================================================================
--- komodo/SciViews-K/templates/.Rprofile (rev 0)
+++ komodo/SciViews-K/templates/.Rprofile 2008-07-06 13:28:04 UTC (rev 44)
@@ -0,0 +1,169 @@
+### SciViews install begin ###
+# SciViews-R installation and startup for running R with Komodo/SciViews-K
+# Merge this with your .Rprofile file in your home directory to configure
+# R automatically at startup
+
+# Make sure we don't process this twice in case of duplicate items in .Rprofile
+if (!exists(".SciViewsReady", envir = .GlobalEnv)) {
+ .SciViewsReady <- FALSE
+ minVersion <- c(R = "2.7.0", svMisc = "0.9-42", svSocket = "0.9-41", svGUI = "0.9-42")
+
+ # Configure socket client/server
+ options(ko.serve = 8888) # Port used by the R socket server
+ options(ko.host = "localhost") # Machine where Komodo is running (local only for the moment)
+ options(ko.port = 7052) # Port used by the Komodo socket server
+ options(ko.id = "R") # The id used for this R kernel in Komodo
+ options(ko.activate = FALSE) # Do we start/activate Komodo at startup?
+ # Note: set ko.activate to TRUE causes problems currently!
+
+ # Load main R packages
+ res <- require(methods, quietly = TRUE)
+ if (res) res <- require(datasets, quietly = TRUE)
+ if (res) res <- require(utils, quietly = TRUE)
+ if (res) res <- require(grDevices, quietly = TRUE)
+ if (res) res <- require(graphics, quietly = TRUE)
+ if (res) res <- require(stats, quietly = TRUE)
+ if (res) {
+ if (capabilities("tcltk")) {
+ # Make sure tcltk can start: on Mac OS X < 10.5 only,
+ # that is, darwin < 9, we need to check that X11 is installed
+ # (optional!) and started!
+ if (regexpr("^darwin[5-8]", R.Version()$os) > -1) {
+ # First, is the DISPLAY environment variable defined?
+ dis <- Sys.getenv("DISPLAY")
+ if (dis == "") {
+ Sys.setenv(DISPLAY = ":0") # Local X11
+ dis <- Sys.getenv("DISPLAY")
+ }
+ # Second, if DISPLAY points to a default local X11, make sure
+ # X11 is installed and started on this machine
+ if (dis %in% c(":0", ":0.0", "localhost:0", "localhost:0.0",
+ "127.0.0.1:0", "127.0.0.1:0.0")) {
+ # X11 is optional on Mac OS X 10.3 Panther and 10.4 Tiger!
+ # We locate 'open-x11' and run it,... not X11 directly!
+ if (length(system('find /usr/bin/ -name "open-x11"',
+ intern = TRUE)) == 0){
+ cat("'open-x11' not found. Make sure you installed X11\n")
+ cat("(see http://developer.apple.com/opensource/tools/runningx11.html\n")
+ res <- FALSE
+ } else { # Make sure X11 is started (trick: we try opening a non X11 prog)
+ system("open-x11 more", intern = TRUE)
+ }
+ }
+ rm(dis)
+ }
+ if (res) {
+ res <- suppressPackageStartupMessages(require(tcltk, quietly = TRUE))
+ if (!res) {
+ cat("Error starting tcltk. Make sure Tcl/Tk is installed and can\n")
+ cat("be run on your machine. Then, with packages svMisc, svSocket\n")
+ cat("and svGUI installed, restart R or type require(svGUI)\n")
+ }
+ }
+ } else cat("Tcl/Tk is required by SciViews, but it is not supported by this R installation\n")
+ } else cat("Problem loading standard R packages, check R installation\n")
+
+ if (res) {
+ # Check for R version
+ res <- compareVersion(paste(R.Version()$major, R.Version()$minor,
+ sep = "."), minVersion["R"])
+ if (res < 0) {
+ cat("R is too old for this version of SciViews, please, upgrade it\n")
+ } else {
+ # Load packages svMisc, svSocket & svGUI (possibly after installing
+ # or upgrading them). User is supposed to have agreed
+
+ ## svMisc
+ desc <- system.file("DESCRIPTION", package = "svMisc")
+ if (desc == "") {
+ cat("Trying to install missing package 'svMisc'\n")
+ install.packages("svMisc", repos = "http://R-Forge.R-project.org")
+ res <- require(svMisc, quietly = TRUE)
+ } else { # Check version
+ if ((compareVersion(packageDescription("svMisc", fields = "Version"),
+ minVersion["svMisc"]) < 0)) {
+ cat("Trying to update package 'svMisc'\n")
+ install.packages("svMisc", repos = "http://R-Forge.R-project.org")
+ }
+ res <- require(svMisc, quietly = TRUE)
+ }
+
+ ## svSocket
+ desc <- system.file("DESCRIPTION", package = "svSocket")
+ if (desc == "") {
+ cat("Trying to install missing package 'svSocket'\n")
+ install.packages("svSocket", repos = "http://R-Forge.R-project.org")
+ res[2] <- require(svSocket, quietly = TRUE)
+ } else { # Check version
+ if ((compareVersion(packageDescription("svSocket", fields = "Version"),
+ minVersion["svSocket"]) < 0)) {
+ cat("Trying to update package 'svSocket'\n")
+ install.packages("svSocket", repos = "http://R-Forge.R-project.org")
+ }
+ res[2] <- require(svSocket, quietly = TRUE)
+ }
+
+ ## svGUI
+ desc <- system.file("DESCRIPTION", package = "svGUI")
+ if (desc == "") {
+ cat("Trying to install missing package 'svGUI'\n")
+ install.packages("svGUI", repos = "http://R-Forge.R-project.org")
+ } else { # Check version
+ if ((compareVersion(packageDescription("svGUI", fields = "Version"),
+ minVersion["svGUI"]) < 0)) {
+ cat("Trying to update package 'svGUI'\n")
+ install.packages("svGUI", repos = "http://R-Forge.R-project.org")
+ }
+ }
+ rm(desc)
+
+ # Try starting the R socket server
+ if (inherits(try(startSocketServer(port = getOption("ko.serve")),
+ silent = TRUE), "try-error")) {
+ cat("Impossible to start the SciViews R socket server\n(socket",
+ getOption("ko.serve"), "already in use?)\n")
+ cat("Solve the problem, then type: require(svGUI)\n")
+ } else {
+ # Finally, load svGUI
+ res[3] <- require(svGUI, quietly = TRUE)
+
+ if (all(res)) {
+ cat("R is SciViews ready!\n")
+ .SciViewsReady <- TRUE
+ if (is.null(getOption("ko.id"))) options(ko.id = "R") # Default
+ # Do we (re)activate Komodo now?
+ koact <- getOption("ko.activate")
+ if (is.null(koact)) koact <- FALSE
+ if (koact[1]) {
+ if ((.Platform$pkgType == "mac.binary")) {
+ Res <- system("osascript -e 'tell application \"Komodo\" to activate'",
+ intern = TRUE)
+ rm(Res)
+ } ### TODO: the same under Windows and Linux
+ # Indicate to Komodo that R is ready
+ koCmd('ko.statusBar.AddMessage("<<<data>>>", "R", 10000, true);',
+ data = paste("'", getOption("ko.id"), "' (R ", R.Version()$major, ".",
+ R.Version()$minor, ") connected", sep = ""))
+ }
+ rm(koact)
+ } else {
+ cat("R is not SciViews ready, install latest svMisc, svSocket & svGUI packages\n")
+ }
+ }
+ }
+ }
+
+ # Clean up .GlobalEnv
+ rm(minVersion, res)
+
+ # Make sure Komodo is started now
+ # Note: in Mac OS X, you have to create the symbolic link manually as explained in the Komodo Help with:
+ # sudo ln -s "/Applications/Komodo Edit.app/Contents/MacOS/komodo" /usr/local/bin/komodo
+ # Or the script will complain with: /bin/sh: line 1: komodo: command not found.
+ system("komodo", wait = FALSE)
+
+ # Make sure to use Komodo as your R editor
+
+}
+
+### SciViews install end ###
\ No newline at end of file
Added: komodo/SciViews-K/templates/R.bat
===================================================================
--- komodo/SciViews-K/templates/R.bat (rev 0)
+++ komodo/SciViews-K/templates/R.bat 2008-07-06 13:28:04 UTC (rev 44)
@@ -0,0 +1,118 @@
+
+ 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 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 defined R_TOOLS (
+ PATH %R_TOOLS%\bin;%R_TOOLS%\perl\bin;%R_TOOLS%\MinGW\bin;%PATH%
+)
+
+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=%path%) && 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 %cmd%==jgr.exe (
+ set st=start
+ set cmdpath=jgr.exe
+ for /f "delims=" %%i in (JGR) do set jgrpkg=%%~$R_LIBS:i
+ if defined jgrpkg set cmdpath=%jgrpkg%\jgr.exe
+ if exist "%R_HOME%\library\JGR\jgr.exe" set cmdpath=%R_HOME%\library\JGR\jgr.exe
+)
+
+if defined st (start "" "%cmdpath%" %args%) else "%cmdpath%" %args%
+goto:eof
+
+
+endlocal
Property changes on: komodo/SciViews-K/templates/R.bat
___________________________________________________________________
Name: svn:executable
+ *
Added: komodo/SciViews-K/templates/Rgui.bat
===================================================================
--- komodo/SciViews-K/templates/Rgui.bat (rev 0)
+++ komodo/SciViews-K/templates/Rgui.bat 2008-07-06 13:28:04 UTC (rev 44)
@@ -0,0 +1,118 @@
+
+ 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 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 defined R_TOOLS (
+ PATH %R_TOOLS%\bin;%R_TOOLS%\perl\bin;%R_TOOLS%\MinGW\bin;%PATH%
+)
+
+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=%path%) && 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 %cmd%==jgr.exe (
+ set st=start
+ set cmdpath=jgr.exe
+ for /f "delims=" %%i in (JGR) do set jgrpkg=%%~$R_LIBS:i
+ if defined jgrpkg set cmdpath=%jgrpkg%\jgr.exe
+ if exist "%R_HOME%\library\JGR\jgr.exe" set cmdpath=%R_HOME%\library\JGR\jgr.exe
+)
+
+if defined st (start "" "%cmdpath%" %args%) else "%cmdpath%" %args%
+goto:eof
+
+
+endlocal
Property changes on: komodo/SciViews-K/templates/Rgui.bat
___________________________________________________________________
Name: svn:executable
+ *
Added: komodo/SciViews-K/templates/SciViews-K 0.6.3.kpz
===================================================================
(Binary files differ)
Property changes on: komodo/SciViews-K/templates/SciViews-K 0.6.3.kpz
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
More information about the Sciviews-commits
mailing list