Re: [R] Questions about sweave...

2006-08-04 Thread Dieter Menne
Brian Lunergan ff809 at ncf.ca writes:

 
 Evening all:
 
 I'm taking a little time to experiment with R, Sweave, and Miktex/LaTex but 
 I've run up against some problems and -well- I hope that there are some on 
 the list who might have some suggestions. This will be kind of wordy as I 
 will include the complete files involved as I'm just not sure what I'm 
 looking for. Apologies at the outset.

This is Windows special

See A.12: 
http://www.ci.tuwien.ac.at/~leisch/Sweave/FAQ.html

And put a commented (!sic) \usepackage into the header (don't remember where I
found this)

% \usepackage{Sweave} 


Dieter

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Questions about sweave... question answered and problem solved

2006-08-04 Thread Brian Lunergan
* Dieter Menne wrote, On 2006-08-04 02:57:
 Brian Lunergan ff809 at ncf.ca writes:
 
 Evening all:

 I'm taking a little time to experiment with R, Sweave, and Miktex/LaTex but 
 I've run up against some problems and -well- I hope that there are some on 
 the list who might have some suggestions. This will be kind of wordy as I 
 will include the complete files involved as I'm just not sure what I'm 
 looking for. Apologies at the outset.
 
 This is Windows special
 
 See A.12: 
 http://www.ci.tuwien.ac.at/~leisch/Sweave/FAQ.html
 
 And put a commented (!sic) \usepackage into the header (don't remember where I
 found this)
 
 % \usepackage{Sweave} 
 
 
 Dieter

Thanks for the lead. Reinstalled R outside of 'c:\program files'. Reran the 
source through Sweave to generate a new example.tex with the preamble:

\documentclass[letterpaper]{article}
\title{Sweave Example 1}
\author{Friedrich Leisch}
\usepackage{C:/R-2.3.1/share/texmf/Sweave}
\begin{document}

Ran it through Latex and everything is as it should be. Problem solved.

-- 
Brian Lunergan
Nepean, Ontario
Canada


---
avast! Antivirus: Outbound message clean.
Virus Database (VPS): 0631-3, 2006-08-04
Tested on: 2006-08-04 14:52:19
avast! is copyright (c) 2000-2006 ALWIL Software.
http://www.avast.com

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] Questions about sweave...

2006-08-03 Thread Brian Lunergan
Evening all:

I'm taking a little time to experiment with R, Sweave, and Miktex/LaTex but 
I've run up against some problems and -well- I hope that there are some on 
the list who might have some suggestions. This will be kind of wordy as I 
will include the complete files involved as I'm just not sure what I'm 
looking for. Apologies at the outset.

I created the source file (example.Snw):

\documentclass[12pt,letterpaper]{article}
\title{Sweave Example 1}
\author{Friedrich Leisch}
\begin{document}
\maketitle

In this example we embed parts of the examples from the 
\texttt{kruskal.test} help page into a \LaTeX{} document:

=
data(airquality)
library(stats)
kruskal.test(Ozone ~ Month , data=airquality)
@

which shows that the location parameter of the Ozone distribution varies 
significantly from month to month. Finally we include a boxplot of the data:
\begin{center}
fig=TRUE , echo=FALSE=
boxplot(Ozone ~ Month , data=airquality)
@
\end{center}
\end{document}

which R seems to accept gracefully to produce the tex file (example.tex):

\documentclass[12pt,letterpaper]{article}
\title{Sweave Example 1}
\author{Friedrich Leisch}
\usepackage{C:/PROGRA~1/R/R-23~1.1/share/texmf/Sweave}
\begin{document}
\maketitle

In this example we embed parts of the examples from the 
\texttt{kruskal.test} help page into a \LaTeX{} document:

\begin{Schunk}
\begin{Sinput}
  data(airquality)
  library(stats)
  kruskal.test(Ozone ~ Month, data = airquality)
\end{Sinput}
\begin{Soutput}
Kruskal-Wallis rank sum test

data:  Ozone by Month
Kruskal-Wallis chi-squared = 29.2666, df = 4, p-value = 6.901e-06
\end{Soutput}
\end{Schunk}

which shows that the location parameter of the Ozone distribution varies 
significantly from month to month. Finally we include a boxplot of the data:
\begin{center}
\includegraphics{example-002}
\end{center}
\end{document}

but when I try to run Latex on it I get errors (example.log):

This is e-TeX, Version 3.141592-2.2 (MiKTeX 2.4) (preloaded format=latex 
2006.8.3)  3 AUG 2006 20:57
entering extended mode
**example.tex
(example.tex
LaTeX2e 2005/12/01
Babel v3.8g and hyphenation patterns for english, usenglishmax, dumylang, noh
yphenation, french, ukenglish, loaded.
(C:\texmf\tex\latex\base\article.cls
Document Class: article 2005/09/16 v1.4f Standard LaTeX document class
(C:\texmf\tex\latex\base\size12.clo
File: size12.clo 2005/09/16 v1.4f Standard LaTeX file (size option)
)
[EMAIL PROTECTED]
[EMAIL PROTECTED]
[EMAIL PROTECTED]
[EMAIL PROTECTED]
[EMAIL PROTECTED]
[EMAIL PROTECTED]
[EMAIL PROTECTED]
[EMAIL PROTECTED]
\abovecaptionskip=\skip41
\belowcaptionskip=\skip42
\bibindent=\dimen102
)
! Missing \endcsname inserted.
to be read again
\protect
l.5 \begin
   {document}
The control sequence marked to be read again should
not appear between \csname and \endcsname.


! LaTeX Error: Missing \begin{document}.

See the LaTeX manual or LaTeX Companion for explanation.
Type  H return  for immediate help.
  ...

l.5 \begin
   {document}
You're in trouble here.  Try typing  return  to proceed.
If that doesn't work, type  X return  to quit.

! Extra \endcsname.
[EMAIL PROTECTED] [EMAIL PROTECTED] -h@@k\endcsname
   [EMAIL PROTECTED] \let 
\CurrentOptio...
l.5 \begin
   {document}
I'm ignoring this, since I wasn't doing a \csname.

! Missing \endcsname inserted.
to be read again
\protect
l.5 \begin
   {document}
The control sequence marked to be read again should
not appear between \csname and \endcsname.

! Extra \endcsname.
[EMAIL PROTECTED]@aded ...er \ifx \csname [EMAIL PROTECTED]
   \relax \expandafter 
[EMAIL PROTECTED]
l.5 \begin
   {document}
I'm ignoring this, since I wasn't doing a \csname.

! Missing \endcsname inserted.
to be read again
\protect
l.5 \begin
   {document}
The control sequence marked to be read again should
not appear between \csname and \endcsname.

! Extra \endcsname.
[EMAIL PROTECTED]@ptions ...xdef \csname [EMAIL PROTECTED]
   [EMAIL PROTECTED] 
[EMAIL PROTECTED]
l.5 \begin
   {document}
I'm ignoring this, since I wasn't doing a \csname.

! Missing \endcsname inserted.
to be read again
\protect
l.5 \begin
   {document}
The control sequence marked to be read again should
not appear between \csname and \endcsname.

! Missing \endcsname inserted.
to be read again
\protect
l.5 \begin
   {document}
The control sequence marked to be read again should
not appear between \csname and \endcsname.

! Extra \endcsname.
argument ...e/texmf/[EMAIL PROTECTED] \endcsname
   ,
l.5 \begin
   {document}
I'm ignoring this, since I wasn't doing a \csname.

! Missing \endcsname inserted.
to be read again