similar to: Sweave and optional document sections

Displaying 20 results from an estimated 2000 matches similar to: "Sweave and optional document sections"

2010 Feb 26
1
Automate generation of multiple reports using odfWeave
Dear R and odfWeave users, I am looking for a way to automate generation of many reports using odfWeave. All reports would use the same input ODT file, the only difference would be in the name of the dataset which will be analyzed in any particular report. Right now, the name of the dataset is hardcoded in the first code chuck in the input file: <<01 get data, echo=TRUE>> station =
2010 Nov 16
4
Simple error handling in R
Hi R experts, I am looking for a simple error handling approach, whereby I could stop function execution with a customized error message. For example: for (i in 1:10) { if (i == 5) # I'd like to be able to stop right here with an error message I have complete control over } The problem with stop() is that I cannot control completely what gets printed to the terminal, even with
2002 Oct 26
3
Using the Search Engine & Keywords
Dear R experts, Can anyone running R on Linux share how they use the "Search Engine & Keywords" page of R documentation? I cannot do any javascript on this page, either searching for a term or following the keyword links. I tried Konqueror (3.0.4, with javascript globally enabled), Mozilla (1.1), and Galeon (1.2.5), but none of them do anything... Sorry, I don't know
2003 Jun 22
1
Using weighted.mean() in aggregate()
Dear R users, I have a question on using weighted.mean() while aggregating a data frame. I have a data frame with columns Sub, Length and Slope: > x[1:5,] Sub Length Slope 1 2 351.547 0.0025284969 2 2 343.738 0.0025859390 3 1 696.659 0.0015948968 4 2 5442.338 0.0026132544 5 1 209.483 0.0005304225 and I would like to calculate the weighted.mean of Slope, using Length
2003 Nov 11
2
Test for new page
Dear R experts, I am writing a multi-page PDF file and would like to put a header on each page. Is there a way to test a graphic device to see if a new page is started (so that I know when to write the header)? I could simply count the plots made (each page has the same number of plots), but wanted to see if a more general solution is available. Thank you, Aleksey -- Aleksey Naumov GIS
2000 Mar 26
2
hist2d() function in R?
Dear R users, I am just starting with R (v. 1.0.0) and I use Vehables & Ripley's MASS book for examples. In the intro session, there is an example of a 2D histogram on an 8x8 grid: x <- rnorm(1000) y <- rnorm(1000) contour(hist2d(x,y,,,8,8)) R complains: Error in contour(hist2d(x, y, , , 8, 8)) : couldn't find function "hist2d" I looked for hist2d() in the
2000 Nov 17
2
Randomly selecting n (unique) elements out of vector of length m...
Dear R users, I wonder if there is a simple way to select a random and non-overlapping subset of a vector? Say, I need to randomly select 10 out of 100 numbers in a vector V. By "non-overlapping" I mean that a number in any position in V (V[1]...V[100]) should be selected at most once (i.e. selection without recycling). I could simplu use a uniform distribution to generate selection
2005 Apr 30
1
legend(): how to put variable in subscript?
Dear List, I would like to plot a simple legend with two math expressions, e.g. plot(0) legend(1, 0.5, expression(sigma[i], sigma[j])) The difficulty is that i and j should be variables rather than strings "i" and "j". In other words I'd like to do something like: i = "A" j = "B" legend(1, 0.5, expression(sigma[i], sigma[j])) and have "A"
2000 Oct 10
1
Adding a new column to data frame (recoding)
Dear R users, I have a very simple question. What is the easiest way to recode data in one of the columns of a data frame and put it into a new column? For example, here is a simple data frame: var1 1 1 2 2 3 3 How do I add a new column to data - 'var2' in which I group values in 'var1', for example: var1 var2 1 1 4 2 2 4 3 3 5 It's got to
2000 Jun 13
3
Question on closure (lexical scoping) and encapsulation
Dear R users, I have two related questions about scoping and data encapsulation. One is fairly specific - I am looking at "scoping.R" which is used in demo(scoping) - it's an example of lexical scoping and encapsulation. Where is the 'total' stored? It is not an attribute in 'ross' or 'robert' however, functions like balance() have access to it. Is it more
2004 Jan 18
3
Syntay-Highlighting for KDE-Kate
I'm looking for a plugin for Kate (or any other good text editor for linux) (KDE 3.x) which will highlight the R syntax. The link on www.r-project.org is dead! Any ideas?? Thanks Lars
2000 Dec 14
1
How do I track a segfault?
Dear R users, I have to catch a nasty bug and would appreciate any advice or help! I get a segfault (core dumped) that happens in one of my own functions. The problem is, it does not happen most of the time, only sometimes, so it's very hard to reproduce. Or it may run ok in interactive mode, but bug out in batch mode. Also, it tends to happen more on the slower of my 2 machines (PII 266),
2008 May 13
1
Problem with odfWeave: Unescaped '<' not allowed in attributes values
Dear R users, I am having a problem with odfWeave: when I run odfWeave('notes.odt', 'notes_out.odt') I get a bunch of errors that start with "Unescaped '<' not allowed in attributes values" in post-processing: <snip> ... 'content_1.xml' has been Sweaved Removing content.xml Post-processing the contents Unescaped '<' not
2000 Jun 20
1
dev2bitmap() problem
Hi R users, dev2bitmap() is not working for me in R-1.1.0. It says: > dev2bitmap("aaa.png") Error in device(...) : Object "width" not found Anyone else has this problem? Aleksey -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info",
2006 Apr 12
2
Location of match?
Is it possible with Ferret to find the location of the matches in a document? For example imagine I have 100 documents and I search with the phrase "bob~0.5" and that returns 3 matching documents. How can I then find all locations in a specific document where it matched "bob~0.5". What I need is something like an array that contains the start index and length for each
2007 Jun 05
1
multiple plot in odfWeave
Hello R users, I found the odfWeave package to create an odf document. It seems to be a very nice tool. So i tried to used it to create a report with multiple plot: I create an odt file with some code inside: I connect to a mysql database I get a list of projects foreach project I would like to make a plot (a map exactly) then in a R console I use the odfweave (inFile, outFile) function.
2010 Feb 09
1
odfTable: table width and alignment
Dear R and odfWeave users, I am trying to figure out how to control table width and alignment on the page for a table generated by odfTable. Based on reading odfWeave documentation (including formattingOut.odt), here is how I manipulate the styles: st = getStyleDefs() # modify the table style tab = getStyles()$table st[[tab]]$align = "center" # seems to have no effect
2008 Apr 14
1
odfWeave: in multi-page plots only last page appears in document
Dear all, Max, first of all, many thanks for providing the odfWeave package. My problem: Whenever I have multiple plots in one single chunk of my ODF file, only the last plot gets shown. The problem can be reproduced with this toy example (to be used in an ODF file together with odfWeave -- I'm using the newest version 0.7.3): <<plot1, echo=FALSE, fig=TRUE>>= for (i in 1:3) {
2010 Nov 16
1
odfWeave - "Format error discovered in the file in sub-document content.xml at 2, 4047 (row, col)"
When using odfWeave on an OpenOffice input document, I can not open the output document. I get the message "Format error discovered in the file in sub-document content.xml at 2,4047 (row,col)" Can anyone help me on this? (Apologies if this has been discussed before; I have not been able to find any info...) Info: I am using R.2.12.0 on Windows 7 (64 bit). I have downloaded the XML
2013 Feb 18
3
odfWeave: Trouble Getting the Package to Work
Hello All, Have recently started learning Sweave and Knitr. Am now trying to learn odfWeave as well. Things went pretty smoothly with Sweave and Knitr but I'm having some trouble with odfWeave. My understanding was that odfWeave should work in pretty much the same way as Sweave. With odfWeave, you set up an input .odt file in a folder, run that file through the odfWeave function, and then