similar to: OT: Adding verbatim R code text into LaTeX documents: texttt; verb or url?

Displaying 20 results from an estimated 6000 matches similar to: "OT: Adding verbatim R code text into LaTeX documents: texttt; verb or url?"

2006 Aug 20
1
issues with Sweave and inclusion of graphics in a document
the problem is a little hard to explain; the .Rnw files (below) probably do a better job, but here goes ... Sweave doesn't like it when i size a graphical device in a code chunk using either, e.g.: windows(width=20, height=5) in Windows, or, e.g. x11(width=20, height=5) under X, when i then plot something in said device and try to include this graphical output in the resulting
2009 Aug 19
3
Sweave output from print.summary.glm is too wide
Hi all I am preparing a document using Sweave; a really useful tool. But I am having a problem. Consider this toy example Sweave file: \documentclass{article} \begin{document} <<echo=TRUE,results=verbatim>>= options(width=40) # Set width to 40 characters hide <- capture.output(example(glm)) # Create an example of the problem, but hide the output summary(glm.D93) #
2012 Nov 01
1
How to nicely display R code with the LaTeX package 'listings'?
Dear expeRts, What's a 'good' (nice-looking, easy-to-read) setup for the LaTeX package 'listings' to display R code? The two versions below are partly inspired by the settings of the package SweaveListingUtils and http://r.789695.n4.nabble.com/R-How-to-format-R-code-in-LaTex-documents-td816055.html Any suggestions, comments, or improvements are welcome. Cheers, Marius ###
2010 Aug 26
3
Using termplot() with transformations of x
Hi all I was playing with termplot(), and came across what appears to be an inconsistency. It would appreciate if someone could enlighten me: > # First, generate some data: > y <- rnorm(100) > x <- runif(length(y),1,2) > # Now find the log of x: > logx <- log(x) > > # Now fit two models that are exactly the same, but specified differently: > m1 <-
2007 Jan 15
4
How to format R code in LaTex documents
Hi, I am planning on putting some R script in an appendix of a LaTex document. Can anyone recommend me a way of how to format it? Is there a way to keep all line breaks without having to insert \\ in every single line? Thank you! Benjamin
2008 Nov 12
1
Understanding glm family documentation: dev.resids
Hi all Consider the family function, as used by glm. The help page says the value of the family object is a list, one element of which is the following: dev.resids function giving the deviance residuals as a function of (y, mu, wt). But reading any of the family functions (eg poisson) shows that dev.resids is a function that computes the *square* of the deviance residuals (at least, by
2004 Feb 05
2
Sweave problem
Here is the file minimal.Snw: \documentclass[a4paper]{article} \title{R tips and tricks} \author{Murray Jorgensen} \usepackage{Sweave} \begin{document} \maketitle \section*{Entering data from a single variable} The following data are transformed tensile strength measurements on polyester fibres. They may be found on the file \texttt{TENSILE.DAT}. We may enter this data into R using the
2007 May 16
1
Problem with Sweave
I am using R 2.5 on a Linux Redhat platform. I can successfully run some example *.Rnw files through Sweave and generate pdf files. When I try my own example file, "test.Rnw": \documentclass[a4paper]{article} \title{Test Sweave Example} \author{Thomas Adams} \begin{document} \maketitle In this example we embed parts of the examples from the \texttt{boxplot} and \texttt{lattice}
2009 Apr 24
2
Error building package: LaTeX error when creating PDF version
Hi all I am trying to build an R package, which I have successfully done many times before, but have an error I cannot trace. I hope someone can help me. Here's is some edited output (full output below if it is useful): pdunn2 at PDunnUbuntu:~/DSdata$ R CMD build GLMsData * checking for file 'GLMsData/DESCRIPTION' ... OK * preparing 'GLMsData': * checking DESCRIPTION
2023 Jul 21
1
tools::parseLatex() crashes on "\\verb{}"
Surprisingly this invalid latex syntax is still formatted "right" in the html output. On a closer look it seems like roxygen2 introduces those, when using markdown backtick quoting, if the quoted content is not syntactic. For instance: #' `c(c(1)` #' `c(c(1))` Will convert the first line to `\verb{c(c(1)}` and the second to `\code{c(c(1))}`. I've opened a ticket there FYI:
2023 Jul 21
1
tools::parseLatex() crashes on "\\verb{}"
Do I understand correctly that we don't want Rd files to be valid latex ? This seems odd to me. I see that `tools::parse_Rd()` doesn't like `\verb!foo!` so maybe roxygen2 is actually doing the right thing (as opposed to just trying to) ? `parse_Rd() ` is probably what I need indeed, for some reason I hadn't found it, so that should fix my own issue here thanks a lot. Le ven. 21 juil.
2007 Dec 19
1
noun-verb vs verb-noun aka dogs black vs black dogs
Wow. I wasn't expecting such a voluminous reply -- some I agree with and some I don't. My apologies for an equally voluminous reply. On Wed, 19 Dec 2007, Tony Plack wrote: > > We're not discussing code or the inner workings of Asterisk or even > > changing the functionality of Asterisk, just what the proper order of > > the words should be. > > > >
2023 Jul 21
1
tools::parseLatex() crashes on "\\verb{}"
? Fri, 21 Jul 2023 15:14:09 +0200 Antoine Fabri <antoine.fabri at gmail.com> ?????: > On a closer look it seems like roxygen2 introduces those, when using > markdown backtick quoting, if the quoted content is not syntactic. For > instance: > > #' `c(c(1)` > #' `c(c(1))` > > Will convert the first line to `\verb{c(c(1)}` and the second to >
2004 Jul 28
1
package.contents() deprecated, what replaces it?
Back on 18-June a colleague (Earl Glynn) asked: ================== I did a ?package.contents in version 1.9.0. The help file says this is deprecated, and says to "see also" Deprecated and Defunct, but what is the "new" function that replaces packge.contents? The function still seems to work, but it's just tagged as deprecated. efg ================== I have the
2012 Sep 11
2
.NAME in .Fortran
Hi all I've been getting some emails from the R package maintainers that I need to update some code in a CRAN packge that uses FORTRAN, to comply with (not so recent) changes. I've been a little busy... I'm having trouble adjusting my code. I hope someone can help. The package was working fine, and a few R functions in my package had lines like this: tmp <- .Fortran(
2005 Jun 16
1
Sweave and sideways
Hi there, I'm rying to 'turn' an Schunk in an .Rnw file(Xemacs-21.4.13, ESS-5.2.8, R-2.1, miktex-2.4.1705). Has anyone got the isorot package to work with Sweave? JC example test.Rnw: \documentclass[a4paper]{article} \usepackage{Sweave} \usepackage{isorot} \rotdriver{dvips} \clockwise \title{Sweave Example 1} \author{apologies to Friedrich Leisch } \begin{document} \maketitle
2002 Nov 13
1
Package documentation and rd.sty
Hi all, I've got a basic question regarding package documentation and rd.sty. I wrote my first own package, and now I would like to place the documentation into the appendix of another LaTex document. Seemingly I cannot simply \usepackage{Rd}, as this will modify the page-settings of my document. Is there a minimum style file which will just define the environments and commands needed for
2003 Dec 26
1
Problems converting output from Sweave to PDf
I am having trouble converting the output from Sweave into a valid PDF file. I have created a simple .Rnw file which will become a full vignette at some point, but during the intermediate testing, I got errors from texi2dvi. This is what I have done. 0) Using a Windows Xp system 1) Created a file called GeneSpring.Rnw 2) Convert this to Tex using Sweave("GeneSpring.Rnw") from within R
2010 Nov 11
4
Troubleshooting sweave
Hi All, I've reproduced the example from Prof. Friedrich Leisch's webpage. When I write sweave("Example-1.Snw") OR sweave("Example-1.Rnw"), (yes, I renamed them). I get the following error: Writing to file example-1.tex Processing code chunks ... 1 : echo term verbatim Error: chunk 1 Error in library(ctest) : there is no package called 'ctest' Also while
2010 Dec 14
0
Sweave problem: lines repeated
Hi all I'm having a problem when using Sweave. Here is a minimal example. My input file (eg, test.Snw) looks like this: <<TESTME,echo=FALSE, results=hide,fig=FALSE,keep.source=TRUE>>= data(cars) m1 <- lm( dist~speed, data=cars ); coef( m1 ) @ <<echo=TRUE,results=verbatim,fig=FALSE,keep.source=TRUE>>= <<TESTME>> @ <<TESTME2,echo=FALSE,