___________________________________________________________

 RManager: support for R, Sweave and knitr [for WinEdt 9]

===========================================================

 by Gilbert Ritschard
 E-mail: gilbert.ritschard@unige.ch

 and Karl Koeller
 E-mail: karlkoeller@gmail.com

 http://www.winedt.org/

___________________________________________________________
                     -*- ASCII -*-


This package provides support for R, Sweave and knitr.

R support is based on the RWinEdt stuff by Uwe Ligges. The support
is here made available in a standard WinEdt session instead of
running it in a limited stand alone WinEdt instance.

---------------------------
 PREREQUISITES
---------------------------

For full functionality of the package, the following R libraries
must be installed in your R system:

 - knitr
 - patchDVI (at least version 1.9.1616)

For interaction with R, it is better if you set R in sdi mode.
Interaction in mdi mode is supported for English language only.

For forward/inverse search you need a PDF reader (such as
SumatraPDF) supporting it.

---------------------------
 INSTALLATION
---------------------------

This package is not compatible with its predecessor R-Sweave, so,
if you have it installed, you must uninstall it before installing.

Open the macro file "Install.edt" in WinEdt, and execute it by
choosing "Macros" menu > "Execute Current Macro".

---------------------------
 POST-INSTALL ACTIONS
---------------------------

For the package to work correctly, Rnw files must have TeX:RNW mode
and Rhtml files must have HTML:RHTML mode. After the installation,
it is recommended to execute the macro file "FixModes.edt" that
comes with the package, which tries to convert the mode of your
files to the mentioned ones.

In case the macro fails to change your files mode, you will have to
manually change them. For example, if you have a file with mode
TeX:US, determined by a comment like

  %  -*- TeX -*- -*- US -*-

you will have to change that line to

  %  -*- TeX -*- -*- RNW -*- -*- US -*-

so that the mode becomes TeX:RNW:US.

---------------------------
 UNINSTALLATION
---------------------------

Open the macro file "Uninstall.edt" in WinEdt (also available in
%b\Uninstall\RManager folder), and execute it by choosing "Macros"
menu > "Execute Current Macro".

---------------------------
 USAGE
---------------------------

A new menu 'R' and a few drop-down toolbar buttons are added, which
contain all available commands of the package.

You can create a new R or Rnw document through the 'New' drop-down
button in the toolbar.

Regarding the compilation of Rnw files, you have the possibility of
choosing between Sweave and knitr, and then PDFLaTeX, XeLaTeX or
LuaLaTeX. The compilers automatically patch the synctex file for
forward/inverse search between Rnw and pdf files.

The command 'Compile' (F9 shortcut) executes the chain knitr ->
PDFLaTeX, and it can be changed to Sweave through the command
'Select Weave Method'.

An 'Rscript' item is added in the Execution Modes dialog, in case
one wants to customize the execution of Sweave and knitr.

Apart from Rnw files, you can knit Rhtml, Rmd and Rrst files. In
the first two cases, the resulting html file is shown after the
compilation.

A few commands are there to facilitate the insertion of R code,
e.g. 'Insert Chunk' inserts a new R chunk ready to be filled.

Chunk labels are collected in the Tree interface for easier
document navigation.

---------------------------
 TIPS AND CAVEATS
---------------------------

This package uses the R library 'patchDVI' for log and synctex
files patching, when using concordance.

Note that, for working with concordance, NEITHER your file name NOR
your file path can contain spaces.

For working with multiple Rnw files, you have to use the syntax

  \SweaveInput{child.Rnw}

in your master document to include child documents when working
with Sweave.

For knitr, it's preferable to include child documents using the
'child' chunk option rather than \SweaveInput, as in

  <<test, child='child.Rnw'>>=
  @

Bear in mind that there are known limitations when using
concordance in multiple-file documents:

- knitr hasn't the ability of generating concordance for child
documents, which means that forward/inverse search isn't accurate
in these cases.

- Log patching doesn't work in multiple-file Sweave documents and,
when using XeLaTeX, even synctex patching doesn't.
