Works perfectly!

Thank you very much, Fritz!

....Tao


From: Friedrich Leisch <[EMAIL PROTECTED]>
To: Tao Shi <[EMAIL PROTECTED]>, [EMAIL PROTECTED], [EMAIL PROTECTED], [email protected]
Subject: Re: [R] How to extract R codes that embedded in a HTML file
Date: Fri, 18 May 2007 15:14:48 +0200


  > -------- Original Message --------
  > Subject: Re: [R] How to extract R codes that embedded in a HTML file
  > using    Stangle?
  > Date: Thu, 17 May 2007 17:01:30 +0000
  > From: Tao Shi <[EMAIL PROTECTED]>
  > To: [EMAIL PROTECTED], [EMAIL PROTECTED]
  > CC: [email protected]

  > : <[EMAIL PROTECTED]>

  > Hi Uwe,

  > Thanks for the answer, but I still need a bit more clearification.  I
  > always
> thought that a .rnw or .snw file is a file mixing word processing markup
  > (e.g. tex or HTML) and R/S code using noweb syntax.  Is the reason for
> 'Stangle' is not working with .rnw file with HTML due to there is no proper > driver available (like RweaveHTML driver for Sweave)? If yes, does R2HTML
  > package have plans to provide a such driver?

  > ....Tao


The following does the trick for me:

R> mytangle <- function ()
      list(setup = RtangleSetup, runcode = utils:::RtangleRuncode,
           writedoc = RtangleWritedoc,
           finish = utils:::RtangleFinish, checkopts = RweaveHTMLOptions)

R> Stangle("/PATH/TO/R/SITE-LIBRARY/R2HTML/samples/example1.snw",
           driver=mytangle)
Writing to file example1.R


Best,
Fritz



_________________________________________________________________
PC Magazine’s 2007 editors’ choice for best Web mail—award-winning Windows Live Hotmail.

______________________________________________
[email protected] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to