"R CMD Sweave --driver=..." woes

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

"R CMD Sweave --driver=..." woes

R devel mailing list
In trying to change the driver used by Sweave on the command line using

   R CMD Sweave --driver=foo

I consistently get the "directory 'foo' does not exist' error. (For any value of 'foo', even the default 'RweaveLatex'.)

Looking up the source code for function .Sweave that is called by 'R CMD Sweave', I notice that the argument 'driver', if used, is added to the vector of arguments of ''buildVignette' without being named. It ends up being passed to argument 'dir', hence rhe error.

I believe the simple patch below should fix the issue, but I wasn't able to test it.

Hope this helps.

v.

Vincent Goulet
Professeur titulaire
École d'actuariat, Université Laval


Index: src/library/utils/R/Sweave.R
===================================================================
--- src/library/utils/R/Sweave.R (revision 78746)
+++ src/library/utils/R/Sweave.R (working copy)
@@ -516,7 +516,7 @@
        do_exit(1L)
    }
    args <- list(file=file, tangle=FALSE, latex=toPDF, engine=engine, clean=clean)
-    if(nzchar(driver)) args <- c(args, driver)
+    if(nzchar(driver)) args <- c(args, driver=driver)
    args <- c(args, encoding = encoding)
    if(nzchar(options)) {
        opts <- eval(str2expression(paste0("list(", options, ")")))

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel
Reply | Threaded
Open this post in threaded view
|

Re: "R CMD Sweave --driver=..." woes

Kurt Hornik-5
>>>>> Vincent Goulet via R-devel writes:

Thanks: fixed now in the trunk with c78751.

Best
-k

> In trying to change the driver used by Sweave on the command line using
>    R CMD Sweave --driver=foo

> I consistently get the "directory 'foo' does not exist' error. (For any value of 'foo', even the default 'RweaveLatex'.)

> Looking up the source code for function .Sweave that is called by 'R CMD Sweave', I notice that the argument 'driver', if used, is added to the vector of arguments of ''buildVignette' without being named. It ends up being passed to argument 'dir', hence rhe error.

> I believe the simple patch below should fix the issue, but I wasn't able to test it.

> Hope this helps.

> v.

> Vincent Goulet
> Professeur titulaire
> École d'actuariat, Université Laval


> Index: src/library/utils/R/Sweave.R
> ===================================================================
> --- src/library/utils/R/Sweave.R (revision 78746)
> +++ src/library/utils/R/Sweave.R (working copy)
> @@ -516,7 +516,7 @@
>         do_exit(1L)
>     }
>     args <- list(file=file, tangle=FALSE, latex=toPDF, engine=engine, clean=clean)
> -    if(nzchar(driver)) args <- c(args, driver)
> +    if(nzchar(driver)) args <- c(args, driver=driver)
>     args <- c(args, encoding = encoding)
>     if(nzchar(options)) {
>         opts <- eval(str2expression(paste0("list(", options, ")")))

> ______________________________________________
> [hidden email] mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel