Khamenia, Valery
2004-Aug-09 15:23 UTC
AW: [R] built-in Sweave-like documentation in R-2.x
> See the 'Writing R Extensions' manual, specifically > Creating R Packages -> Writing package vignettesthank you, i saw this entry. However, this entry is rather about how to include documents (in particular Sweave-based) into a package. But I have meant smth else. Let me explain in example. Today I use emacs as environment for my R-sessions. I am quite happy to use Sweave, but not happy, that there is no good possibility to run some selected *part* of the R-code. Indeed, the R-chunks are alternated with Latex-chunks in Sweave. So, if one would like to execute, say, three consequent R-chunks (C-c C-r in ESS-mode), then the corresponding Latex-chunks between the R-chunks will cause "side-effects". Actually, it is because neither ESS nor R could accept Latex-chunks and the markup symbols of Sweave. This makes interactive work in .Rnw files not fully convenient. Making the above short: would it be a bad idea to allow Latex-friendly documentation chunks in R-language? Thank you. P.S. I am sorry if i missed something well-known concerning the subj. -- Valery.
On Monday 09 August 2004 10:23, Khamenia, Valery wrote:> > See the 'Writing R Extensions' manual, specifically > > Creating R Packages -> Writing package vignettes > > thank you, i saw this entry. However, this entry is rather > about how to include documents (in particular Sweave-based) > into a package. But I have meant smth else. > > Let me explain in example. Today I use emacs as > environment for my R-sessions. I am quite happy to > use Sweave, but not happy, that there is no good > possibility to run some selected *part* of the R-code. > Indeed, the R-chunks are alternated with > Latex-chunks in Sweave. So, if one would like to > execute, say, three consequent R-chunks (C-c C-r in ESS-mode), > then the corresponding Latex-chunks between the > R-chunks will cause "side-effects". Actually, it is > because neither ESS nor R could accept Latex-chunks > and the markup symbols of Sweave. This makes interactive > work in .Rnw files not fully convenient.Is selecting and 'C-c C-r'-ing the 3 chunks separately that bad? The pieces for what you want are there. You can use Stangle() on a Sweave format file to extract the R code chunks. In your usage, a crude implementation would involve writing your selection to a file, running Stangle on it, and source()-ing the resulting .R file. Others may have better suggestions. Deepayan
If you name chunks that should be run together the same thing (i.e. similar to how Noweb suggests that you should create documents), then ess-eval-thread will evaluate all chunks in the thread (i.e. that noweb would have sent to the same file upon tangling). This is similar to the ess-eval-chunk ESS function. "Khamenia, Valery" <V.Khamenia at biovision-discovery.de> writes:>> See the 'Writing R Extensions' manual, specifically >> Creating R Packages -> Writing package vignettes > > thank you, i saw this entry. However, this entry is rather > about how to include documents (in particular Sweave-based) > into a package. But I have meant smth else. > > Let me explain in example. Today I use emacs as > environment for my R-sessions. I am quite happy to > use Sweave, but not happy, that there is no good > possibility to run some selected *part* of the R-code. > Indeed, the R-chunks are alternated with > Latex-chunks in Sweave. So, if one would like to > execute, say, three consequent R-chunks (C-c C-r in ESS-mode), > then the corresponding Latex-chunks between the > R-chunks will cause "side-effects". Actually, it is > because neither ESS nor R could accept Latex-chunks > and the markup symbols of Sweave. This makes interactive > work in .Rnw files not fully convenient. > > Making the above short: would it be a bad idea to > allow Latex-friendly documentation chunks in > R-language? > > Thank you. > > P.S. I am sorry if i missed something well-known > concerning the subj. > -- > Valery. > > ______________________________________________ > R-help at stat.math.ethz.ch mailing list > https://www.stat.math.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html >-- Anthony Rossini Research Associate Professor rossini at u.washington.edu http://www.analytics.washington.edu/ Biomedical and Health Informatics University of Washington Biostatistics, SCHARP/HVTN Fred Hutchinson Cancer Research Center UW (Tu/Th/F): 206-616-7630 FAX=206-543-3461 | Voicemail is unreliable FHCRC (M/W): 206-667-7025 FAX=206-667-4812 | use Email CONFIDENTIALITY NOTICE: This e-mail message and any attachme...{{dropped}}
Khamenia, Valery
2004-Aug-10 07:53 UTC
AW: [R] built-in Sweave-like documentation in R-2.x
hi tony,> What exactly do you mean by this? > 1. generation of Sweave-style docs from R programs or interaction?neither (if i correctly interpret your question).> 2. tools for doing docs and analysis at the same time? Emacs Speaks > Statistics has supported this with R since last century (1997 or so).as you have seen, i use emacs and even since last century :)> 3. the vignettes of Bioconductor?not sure.> 4. a text book in line with the above?nope. I think just smarter C-c C-r would be kind of trade-off here. hm, maybe there are some other voices here similar to mine? It would be easier to discuss the subj. -- Valery.
Hello, I have run across the following problem: Creating PDF files manually by using pdf(version=1.4) I can make graphs using the new transparency feature of R2.0. If, however, I try to create the same graphs with Sweave, all transparent stuff is gone. This os likely due to the default version parameter in in pdf(). How can I tell Sweave to use the newer PDF version? The parameter seems to be hard-coded (not via some option) and I could not come up with some kind of hook ... Thank you Benno
>>>>> On Thu, 04 Nov 2004 14:20:21 +0100, >>>>> Benno P??tz (BP) wrote:> Hello, > I have run across the following problem: > Creating PDF files manually by using > pdf(version=1.4) > I can make graphs using the new transparency feature of R2.0. If, > however, I try to create the same graphs with Sweave, all transparent > stuff is gone. This os likely due to the default version parameter in in > pdf(). > How can I tell Sweave to use the newer PDF version? The parameter seems > to be hard-coded (not via some option) and I could not come up with some > kind of hook ... Good point, currently I see no way short of directly creating the PDF file and manually including it in latex, i.e., do ********************************************************** <<fig=false>>pdf(file="foo.pdf", version="1.4") myplot(...) dev.off() @ \incudegraphics{foo} ********************************************************** But we should think about a more general mechansim to specify defaults for the PDF device (not only for Sweave). -- ------------------------------------------------------------------- Friedrich Leisch Institut f??r Statistik Tel: (+43 1) 58801 10715 Technische Universit??t Wien Fax: (+43 1) 58801 10798 Wiedner Hauptstra??e 8-10/1071 A-1040 Wien, Austria http://www.ci.tuwien.ac.at/~leisch