Displaying 20 results from an estimated 4000 matches similar to: "Sweave in LATEX"
2007 Oct 07
5
how to use \Sexpr{} with sweave
I'm trying to learn Sweave. So far things are going well with the chunks of code identified by << >>=
But I'm having trouble with the in-line text use of \Sexpr.
Here is a short example .Rnw file:
\documentclass[12pt]{article}
\usepackage[margin=1.25in]{geometry}
\usepackage{graphicx}
\usepackage{Sweave}
\begin{document}
<<test>>=
pnorm(1)
@
\Sexpr{2+6}
2004 Jul 05
1
Apparent conflict between \Sexpr in Sweave and R2HTML
I have come across an apparent bug in the operation of Sweave. If I
load the package R2HTML then execution of \Sexpr{} in an *.Rnw file no
longer works. The \Sexpr{} code is simply written to the *.tex file.
Below are my *.Rnw file, commands, and output.
The Sweave file, Sweave-test-1_short.Rnw:
% -*- mode: noweb; noweb-default-code-mode: R-mode; -*-
\documentclass{article}
\title{A Test
2012 Feb 23
1
Sexpr not getting expanded in Sweave
An Sweave file, 'test.Rnw':
\documentclass{article}
\title{Sweave minimal}
\author{MK}
\begin{document}
\maketitle
We try Sweave:
<<1>>=
data(airquality)
summary(airquality)
x <- airquality[1, 1]
@
I try Sexpr: \Sexpr{x}
We plot:
\begin{center}
<<2, fig=TRUE, echo=FALSE >>=
boxplot(Ozone ~ Month, data = airquality)
@
\end{center}
\end{document}
I check the
2013 Sep 02
1
Sweave: printing an underscore in the output from an R command
I am working with Sweave and would like to print out into my latex document the result of the R command
version$platform
So what I first tried in my .Rnw document was \Sexpr{print(version$platform)}.
However, the output from this command is the string "x86_64-apple-darwin10.8.0" (without the quotes). This contains an underscore, which is a special character in tex and so I get an error
2008 Apr 17
1
odfWeave \Sexpr
Dear All,
Using odfWeave is working fine for me using code chunks <<...>>= ... @
But the inline \Sexpr{date()} is not evaluated and returns again
\Sexpr{date()} instead of "Thu Apr 17 18:15:47 2008".
What might be the reason for that, what do I have to look for?
I'm using Windows XP, R 2.6.1, odfWeave_0.7.3 and OpenOffice 2.4.
Session Info:
R version 2.6.1
2006 Sep 20
2
Sweave processes \Sexpr in commented LaTeX source (2.3.1patched and 2.4.0)
Hi all,
On FC5, using:
Version 2.3.1 Patched (2006-08-06 r38829)
and today's
R version 2.4.0 alpha (2006-09-19 r39397)
with the following .Rnw file:
\documentclass[10pt]{article}
\begin{document}
This line should print '2': \Sexpr{1 + 1}
%% This line should NOT print '2': \Sexpr{1 + 1}
\end{document}
The \Sexpr in the second line is processed even though the
2006 Sep 20
2
Sweave processes \Sexpr in commented LaTeX source (2.3.1patched and 2.4.0)
Hi all,
On FC5, using:
Version 2.3.1 Patched (2006-08-06 r38829)
and today's
R version 2.4.0 alpha (2006-09-19 r39397)
with the following .Rnw file:
\documentclass[10pt]{article}
\begin{document}
This line should print '2': \Sexpr{1 + 1}
%% This line should NOT print '2': \Sexpr{1 + 1}
\end{document}
The \Sexpr in the second line is processed even though the
2008 Mar 19
4
Sweave does not parse \Sexpr{}
Hi,
has anybody encountered and solved the following
problem?
I continued work now on a different computer where I
have also used Sweave successfully before. I can run
Sweave() and it generates a .tex file. All code chunks
are processed and translated to Latex perfectly fine
but somehow only the \Sexpr{} tags are not parsed.
This is an example .Rnw:
\documentclass{article}
\usepackage{Sweave}
2006 Aug 04
2
Sweave special token \\ from R to latex
Dear helpeRs,
I would like to specify a newline command in R and pass it to latex
via Sweave such that it corresponds to latex' \\ command. But that
doesn't seem to be possible. If I Sweave the \n character, it just
makes a new line in latex but not the \\ command.
Is there a way such that the following code would result in latex in
blablabla \\ blablabla on different line
2006 Sep 21
2
Sweave processes \Sexpr in commented LaTeX source
Marc,
>I have a large .Rnw file and was in the process of doing some debugging.
>I had set some R chunks to 'eval=false' in the process. This resulted in
>some R objects not being created that were in turn used in the
>subsequent \Sexpr's.
I have often the same problem, I'm using a construct like :
<<eval=F>>=
x <- rnorm(100)
@
I have
2010 Sep 30
2
Sweave and LaTeX beamer class
I am failing to uncover Sweave chunks step by step using the LaTeX beamer
class.
The following minimal example:
\documentclass{beamer}
\usepackage{Sweave}
\begin{document}
\begin{frame}[fragile]
In the year \uncover<2->{25}\uncover<3->{\Sexpr{5*5}}
\uncover<4->{
<<echo=TRUE, print=TRUE>>=
5*5*101
@
}
\end{frame}
\end{document}
leads to an error message when
2007 Nov 29
1
extracting items from R objects and using them in \Sexpr with Sweave--problem with $
Running R 2.5.1 on WinXP with Tinn-R, and using Sweave via MikTex.
I am having trouble with the code below:
-------------------------------------------------------
<<lowerCI95>>=
lowerCI95713 <- t.test(data713, alternative="greater")
lowerCI95713.bound <- lowerCI95713$conf.int[1]
@
Thus a lower 95\% confidence bound on the mean octane concentration is
2012 Apr 02
1
\Sexpr{}
Did anyone know whether the problem " it doesn't evaluate \Sexpr{} in Sweave" has been fixed? I checked r help page and realized it was asked a couple of years ago. But I didn't find solutions.
Thanks for your help in advance!
Hua
[[alternative HTML version deleted]]
2004 Dec 20
3
Sweave and LaTeX beamer class
Hi,
has anyonne experienced problems between the LaTeX beamer class and
Sweave? The following code does not work properly:
#################################
\documentclass{beamer}
\usepackage[latin1]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{ngerman}
\begin{document}
\frame{
\frametitle{test}
test
<<>>=
1+1
@
}
\end{document}
#################################
Below is the
2009 May 09
2
Sweave \Sexpr{} advice please
Dear List,
First off, my deepest gratitude to the Sweave developers: this tool has
improved my quality greatly.
A question in my work I use \Sexpr{} statements scalar values and the xtable
package for all manner of tables. What I'd like to do is to use a vector
inline, rather than a whole separate table. Something like:
%%%%%%%%%%%%%%%% begin code
% Latex junk
% Sweave block:
2006 Dec 20
2
\Sexpr in MikTex
Greetings, \Sexpr{} has worked on MikTex with earlier versions of R, I can not seem to get it to work with
R-2.4.0. I run Sweave with MikTex using the following statement in Run under Accessories.
latex -include-directory="C:\Program Files\R\R-2.4.0\share\texmf" "C:\Documents and Settings\Suzette\Desktop\MyFile\MyProgram.tex"
Any advice would be much appreciated,
Suzette
2010 Nov 29
1
Sweave choking on \\ in filename
Dear all,
Sweave chokes when using "\\" in the path to the Rnw file. Using "/"
works fine. The problem is that Eclipse+StatET uses "\\" in the
filename.
And example of the error, traceback and sessionInfo are given below.
Best regards,
Thierry
> Sweave("Q:\\BMK\\cursussen\\interne_opleiding\\deelnemerslijst.Rnw",
syntax="SweaveSyntaxNoweb")
2009 Jun 30
2
Sweave: multiline Sexpr?
Is there any way to have Sexpr span multiple lines?
--
David
?
-----------------------------------------------------
David Huffer, Ph.D. Senior Statistician
CSOSA/Washington, DC david.huffer at csosa.gov
-----------------------------------------------------
2009 Feb 04
2
Sweave and \Sexpr{}
Hi:
I am trying to create a dynamic latex table using \Sexpr{} but it's not evaluating it. I also tried the example below without Sweave and also fails. I have also copied the Sweave.sty to my working directory but nothing seems to work. Do I need to have certain package in order to run \Sexpr{}?
\documentclass[a4paper]{article}
\usepackage{C:/R/R-2.8.1/share/texmf/Sweave}
\begin{document}
2011 Jan 26
2
Sweave: \Sexpr{} inside <<>>?
Hi,
Is it possible in Sweave to put \Sexpr{} inside <<>>? This is a bad
example, but here goes:
<<results=hide>>
Age <- 5
@
<<>>
x <- \Sexpr{Age}
@
I'm trying to get it to display x <- 5, rather than x <- Age. It's probably
so obvious I'm going to feel sorry for having to ask, just the same, I'm
stumped. Any ideas? Thanks.
--