[R] Sweave : allowing errors in R code?

Duncan Mackay mackay at northnet.com.au
Tue Aug 9 08:32:14 CEST 2011


Hi Remko

After thinking about try and tryCatch the problem was catching the error
what about ?captureOutput

Regards

Duncan

At 14:28 09/08/2011, you wrote:
> > Hi Remko,
> >
> > How about ?try
> >
> > Hope it helps,
> >
> > Tsjerk
> >
>
>Not quite, because then the code chunk in the final doc. will have this
>try() around it as well - not too pretty for a user manual.
>
>
>remko
>
>
>
>
> > On Aug 9, 2011 5:30 AM, "Remko Duursma" <remkoduursma at gmail.com> wrote:
> >
> > Dear R-helpers,
> >
> >
> > sorry if this is obvious, but I can't find this in the documentation.
> >
> > I am using Sweave, and have some code that does not actually work - but I
> > want to include it anyway, including the error message that R produces.
> >
> > But on running Sweave() on my .Rnw file, it simply halts when it gets to
> > the
> > code chunk with the bad code.
> >
> > I can use \verbatim{} instead, but then I don't get R's output
> > automatically
> > (nor do I get the nice syntax highlighting from the highlight package that
> > I
> > am using).
> >
> >
> > thanks for your help,
> > Remko
> >
> > --
> > View this message in context:
> > 
> http://r.789695.n4.nabble.com/Sweave-allowing-errors-in-R-code-tp3728790p3728790.html
> > Sent from the R help mailing list archive at Nabble.com.
> >
> > ______________________________________________
> > R-help at r-project.org 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.
> >
> >
>
>         [[alternative HTML version deleted]]
>
>______________________________________________
>R-help at r-project.org 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.



More information about the R-help mailing list