Skip to content

Sweave and paths

2 messages · Bill Rising, Friedrich Leisch

#
Is there some way to encourage \SweaveInput{foo} to find foo in a  
subdirectory of a file tree? Something along the lines of the  
behavior of list.files(<stuff>, recursive=TRUE). This would be very  
helpful at calling small modular files, such as solution sets and the  
like.

I couldn't see anything in the documentation, and I looked in the  
source code, but it seems that SweaveReadFiledoc() wants to look only  
in the directory which contains foo.

Still, I'm guessing that I'm missing something. Any tips would be  
much appreciated.

Bill
1 day later
#
> Is there some way to encourage \SweaveInput{foo} to find foo in a  
  > subdirectory of a file tree?

Sure: Write some code doing it ;-)

  > Something along the lines of the  
  > behavior of list.files(<stuff>, recursive=TRUE). This would be very  
  > helpful at calling small modular files, such as solution sets and the  
  > like.

  > I couldn't see anything in the documentation, and I looked in the  
  > source code, but it seems that SweaveReadFiledoc() wants to look only  
  > in the directory which contains foo.

Well, if you know where it is you can always use the path in the
\SweaveInput{} statement, i.e.,

	\SweaveInput{foo/bar}

works for me.

Best,