inst/doc/rtfSweave-intro.R

### R code from vignette source 'rtfSweave-intro.Rnw'

###################################################
### code chunk number 1: rtfSweave-intro.Rnw:216-224
###################################################
preprocess <- function(original.rtf, new.rtf){
  doc <- readLines(original.rtf)
  doc <-
    sub("^{\\paragraph$",
        "{\\pard \\sb120 \\sa120 \\f0 \\fs24",
        doc)
  writeLines(doc, new.rtf)
}


###################################################
### code chunk number 2: rtfSweave-intro.Rnw:284-292
###################################################
tmp <- tempfile()
png(tmp, height = 2, width = 2, units = "in", res = 10)
plot(1:10)
dev.off()

size <- file.info(tmp)$size
hex <- readBin(tmp, what = "raw", size)
cat(hex, fill = 60, sep = " ")

Try the rtfSweave package in your browser

Any scripts or data that you put into this service are public.

rtfSweave documentation built on June 21, 2022, 3:01 p.m.