search for: sweavedriv

Displaying 2 results from an estimated 2 matches for "sweavedriv".

Did you mean: sweavedriver
2011 Jun 20
1
Quote the path of graphics output in Sweave when it contains spaces
...uot;valid filename" in .SweaveValidFilenameRegexp, but I think it might be better to quote the filename when it contains spaces instead of just giving a warning. This should bring us safer LaTeX code (although I never use spaces in paths). Here is the simple patch: Index: src/library/utils/R/SweaveDrivers.R =================================================================== --- src/library/utils/R/SweaveDrivers.R (revision 56193) +++ src/library/utils/R/SweaveDrivers.R (working copy) @@ -390,6 +390,8 @@ } if (options$include) { + if (grepl("[[:space:...
2010 Dec 14
1
embed Sweave driver in .Rnw file
...846) +++ src/library/utils/R/Sweave.R (working copy) @@ -20,6 +20,16 @@ # We don't need srclines for code, but we do need it for text, and it's easiest # to just keep it for everything. +SweaveGetDriver <- function(file){ + txt <- readLines(file) + line <- grep( "\\SweaveDriver", txt, value = TRUE ) + if( length(line) ){ + txt <- sub( "^.*\\SweaveDriver[{](.*)[}]", "\\1", line[1L] ) + driver <- try( eval( parse( text = txt ) ), silent = TRUE ) + if( !inherits( driver, "try-error") ) driver + } +} + Sw...