Displaying 20 results from an estimated 11000 matches similar to: "Sweave: Variables in code chunk headers"
2011 Mar 23
3
Sweave: multiple graphic formats, e.g. win.metafile
Dear R devel,
being constrained to a windows environment at work and having colleagues being accustomed to the Microsoft Office Suite, I was looking for a way to have the RweaveLatex driver for Sweave automatically generating 'win.metafile's in addition to the pdf graphics.
Without this functionalilty, the generation of emf-graphics is quite laborious, I think:
<<>>=
plotit
2003 Dec 04
2
passing par() options to pdf under Sweave
I'm using Sweave to generate LaTeX output from R. Thank-you
very much for this capability. It is very useful.
Could someone please tell me how to pass non-default
graphics parameters from par() to the pdf driver when it is
called by Sweave?
(I need to change some of the margin defaults. )
Hoping there is an easy solution to this question,
Anne York
2005 Nov 17
3
changing figure size in Sweave
Hi
In Sweave, how does one change the size of the plots?
I tried using a hook:
<<echo=FALSE, print=FALSE, fig=TRUE>>=
options(SweaveHooks=list(fig=function() ps.options(width=1)))
library(graphics)
pairs(iris)
@
but this didn't change the size of the figure. How to make the
figures a
different size?
--
Robin Hankin
Uncertainty Analyst
National Oceanography Centre,
2010 Mar 05
2
Sweave and optional document sections
Dear R and Sweave users,
Is there a way to have optional sections in a Sweave-generated report
document, complete with section header(s), text and code chunks? In other
words, I'd like for my report to include or omit certain sections based on
the data itself.
For example, If I examine the input dataset early on in the report and set a
variable has_daily_data = TRUE, then I'd like to
2012 Aug 21
2
Sweave: R chunk inside caption?
Hi Folks,
I'm surprised, but I didn't find this question addressed anywhere. I'd
like to generate a LaTeX caption with R code. I've tried the code
below, but I get the following TeX error:
! Argument of \@caption has an extra }.
<inserted text>
\par
l.21 }
Any thoughts? Perhaps I'll have to write the "\caption{}" text with R?
thanks!
2011 Feb 22
1
odfWeave graphics glitch
Using R2.12.1 on Ubuntu 10.04.1 I've tried to run the following code chunk in odfWeave
<<fig1, echo=TRUE,fig=TRUE,width=7,height=4>>=
x<-seq(1:100)/10
y<-sin(cos(x/pi))
imageDefs <- getImageDefs()
imageDefs$dispWidth <- 4.5
imageDefs$dispHeight<- 4.5
setImageDefs(imageDefs)
X11(type="cairo")
plot(x,y)
title(main="sin(cos(x/pi))")
2009 Feb 11
2
plots and text to the same output file
Hello,
I would like to save different plots and some text (like summaries, AIC, ...) on the same file.
I've read the e-mails entitled "Output results to a single postscript document" written some days ago and I've tried
to use the function odfInsertPlot() in the package "odfWeave" but it doesn't work on my computer (I've seen that
odfWeave package depends on
2007 Jun 28
4
Sweave bug? when writing figures / deleting variable in chunk
I have found a quite strange (to me) behaviour in Sweave. It only
occurs in the following situation:
1. define a variable in one chunk
2. use it within a subsequent figure-generating chunk
3. delete it at the end of that same chunk
Then the Sweave driver chokes, not finding the variable name when
generating the figure
Example:
% document bug2.Rnw
\documentclass{article}
\usepackage{Sweave}
2007 Jun 22
1
Lattice: hiding only some strips
I am using R 2.4.0 and lattice to produce some xyplots conditioned on a
factor and a shingle. The shingle merely chops up the data along the
x-axis, so it is easy to identify which part of the shingle a panel is
in by looking at the x-axis markings. I only want to have a strip at the
top for the factor.
Is this possible? I looked into calculateGridLayout() and it seems to me
that there
2007 Jul 03
1
Lattice: shifting strips to left of axes
Consider this plot:
xyplot(mpg ~ disp | cyl, mtcars, strip=F, strip.left=T, layout=c(1, 3),
scales=list(relation="free"),
par.settings=list(strip.background=list(col="transparent")))
I want to have the "cyl" strip labels on the left side of the axis. Is
this possible?
Failing that, is it possible to remove the left axis and display it on
the right
2011 Apr 16
1
Sweave, SweaveHooks and printing the label
I would like to print the label of each code chunk, just before printing the
code chunk itself. Is that possible using SweaveHooks, or by some other
mechanism?
Thanks
David
--
View this message in context: http://r.789695.n4.nabble.com/Sweave-SweaveHooks-and-printing-the-label-tp3453829p3453829.html
Sent from the R help mailing list archive at Nabble.com.
2009 Jun 30
1
odfWeave : problems with odfInsertPlot() and odfFigureCaption()
Dear Max, dear list,
I have trouble using odfInsertPlot to insert plots outside fig=TRUE
chunks.
My goal is to dump a bunch of (relatively uninteresting, but required)
graphs from within a loop, possibly interspeded with some tables. This
is not possible within a normal fig=TRUE chunk.
odfInsertPlot() is able to insert a previously saved plot. When used in
a fig=TRUE, results=hide chunk, it
2008 Aug 12
2
Possible buglet (wart ?) of odfWeave 0.7.6 (with workaround)
Dear List,
I have had problems inserting some (not all !) figures via odfWeave
(using print(someLatticeFunction)...). The figure was correctly
displayed in a R device window but the resulting ODF document displayed
the correct space for the figure and an empty frame with a "broken
image" icon and a "read error" mention.
Exploration of the odf (.odt, in my case) file showed
2010 Dec 11
5
(S|odf)weave : how to intersperse (\LaTeX{}|odf) comments in source code ? Delayed R evaluation ?
Dear list,
Inspired by the original Knuth tools, and for paedaogical reasons, I wish
to produce a document presenting some source code with interspersed
comments in the source (see Knuth's books rendering TeX and metafont
sources to see what I mean).
I seemed to remember that a code chunk could be defined piecewise, like in
Comments...
<<Chunk1, eval=FALSE, echo=TRUE>>=
2009 Jul 06
1
odfWeave: odt-file damaged
Dear all,
I am doing my first steps with odfWeave.
After running the r code (see below), I am trying to open the ODF-document
with open office, but I am getting the error message:
"The file is damaged, but it can be repaired". If I confirm the question and
repair the file with open office, I can open it with the desired output,
which seems to be fine.
My system:
R Version 2.9.1
2010 Nov 15
1
Sweave: Conditional code chunks?
I have a code junk that produces a figure. In my special case,
however, data does not always exist. In cases where data exists, the
code chunk is of course trival (case #1), however, what do I do for
case # 2 where the data does not exist?
I can obviously prevent the code from being executed by checking the
existence of the object x, but on the Sweave level I have a static
figure chunk. Here an
2010 Aug 10
1
Sweave with dev.new()
Dear list.
I am preparing a R package, and the last step is to write a package
vignette using Sweave. However, I am experiencing some trouble when trying
to include plots in my Sweave document. That is, in my package I have made
some plotting functions in which I start by calling 'new.dev()' to start a
graphics device of a certain width and height, and then proceed with
plot(). These
2011 Aug 20
1
Groups and bwplot
Dear R-users,
A while ago, Deepayan Sarkar suggested some code that uses the group
argument in bwplot to create some 'side-by-side' boxplots
(https://stat.ethz.ch/pipermail/r-help/2010-February/230065.html). The
example he gave was relatively specific and I wanted to generalize his
approach into a function. Unfortunately, I seem to have some issues
passing the correct arguments to the
2012 Feb 20
2
Computing plot size in Sweave
Sometimes you want to compute the physical size of a plot based on data.
In R itself this is no problem.
But is there a way to compute the values of height and width in S-weave, say:
<<graph,fig=TRUE,height=xx,width=yy>>=
where xx and yy are computed and not physically written in the document?
Bendix
______________________________________________
Bendix Carstensen
Senior
2013 Feb 13
2
sweave question
Hi Everyone: I was having trouble getting the plot size correct when
putting a plot in an sweave document. So, I searched on the internet and I
found a clever solution where the person uses
the cat function to write latex code so he can include the cat code in the
chunk and place the plot using width and height. The solution is here:
https://stat.ethz.ch/pipermail/r-help/2009-April/195094.html.