[R] SweaveInput and absolute paths

Kevin R. Coombes krc at mdacc.tmc.edu
Fri Apr 27 16:57:56 CEST 2007


The path is correct, and the file exists.  Here is a transcript of the R 
session:

-----------------
 > sessionInfo()
R version 2.4.0 (2006-10-03)
i386-pc-mingw32

locale:
LC_COLLATE=English_United States.1252;LC_CTYPE=English_United 
States.1252;LC_MONETARY=English_United 
States.1252;LC_NUMERIC=C;LC_TIME=English_United States.1252

attached base packages:
[1] "methods"   "stats"     "graphics"  "grDevices" "utils"  "datasets"
[7] "base"
 > getwd()
[1] "G:/Working/Fidler-Nakamura-Periphery"
 > dir("M:/Resources/Affymetrix")
  [1] "affyExample.Rnw" "affyExample.tex" "affyplots.Rnw"  "chkMiame.Rnw"
  [5] "fnp.Rnw"         "libLoad.Rnw"     "readCel.Rnw"    "rma.Rnw"
  [9] "rnadeg.Rnw"      "simpleQC.Rnw"
 > Sweave("affyExample.Rnw")
Writing to file affyExample.tex
Processing code chunks ...
Error in SweaveReadFile(c(ifile, file), syntax) :
         no Sweave file with name 
'./M:/Resources/Affymetrix/libLoad.Rnw' found
In addition: Warning message:
list.files: './M:/Resources/Affymetrix' is not a readable directory
-----------------

Dieter Menne writes:
 > Kevin R. Coombes <krc <at> mdacc.tmc.edu> writes:
 >
 > >
 > > Is there a way to turn off the automatic inclusion of "./" at the
 > > beginning of a path specified in an \SweaveInput{} instruction?
 > >
 >
 > Giving a full file path name works for me (Windows, R 2.4.1)
 >
 > \SweaveInput{C:/tmp/MyTitle.rnw}
 >
 > Note the if the path does not exist, e.g
 >
 > \SweaveInput{C:/tmpnotexist/MyTitle.rnw},
 >
 > the error message refert to  "./C:/tmpnotexist/MyTitle.rnw", so it
 > could be that the path you chose had been incorrectly entered.
 >
 > Dieter



More information about the R-help mailing list