Dan Tenenbaum
2015-Jun-24 20:31 UTC
[Rd] system2() shortens R.home() to 8.3 form on windows
Hi, So in an interactive R session, R.home() returns the following:> R.home()[1] "D:/biocbld/bbs-3.2-bioc/R" However, if I call it from system2(), I get different results:> system2("R", "-q -e R.home()") > R.home()[1] "D:/biocbld/BBS-3~1.2-B/R" Similarly:> system2("R", "-q -e Sys.getenv('R_HOME')") > Sys.getenv('R_HOME')[1] "D:/biocbld/BBS-3~1.2-B/R" ?R.home says: "On Windows the values of 'R.home()' and 'R_HOME' are guaranteed not to contain spaces, switching to the 8.3 short form of path elements if required." Not sure if this is relevant, but there are no spaces in my path to begin with, so not sure why the conversion to 8.3 form was thought to be required. It's a problem because we are running R CMD check on a package that generates a tex file which ends up containing a ~ in the path to Sweave.sty, and MikTex ends up interpreting the ~ literally, so the unit test fails. If we run the unit tests manually they pass. But in the context of R CMD check they fail, apparently because system2() is invoked at some point. R version 3.2.1 (2015-06-18) Platform: x86_64-w64-mingw32/x64 (64-bit) Running under: Windows Server 2008 R2 x64 (build 7601) Service Pack 1 locale: [1] LC_COLLATE=C [2] LC_CTYPE=English_United States.1252 [3] LC_MONETARY=English_United States.1252 [4] LC_NUMERIC=C [5] LC_TIME=English_United States.1252 attached base packages: [1] stats graphics grDevices utils datasets methods base Thanks, Dan
Seemingly Similar Threads
- R_HOME path getting munged in inst/doc/Makefile on Windows
- "Failed to locate the 'texi2pdf' output file"
- "Failed to locate the 'texi2pdf' output file"
- Failed to locate 'weave' output file / vignette product does not have a known filename extension
- R CMD check --force-multiarch does not install all the archs for testing