Le mar. 25 mars à 17:12, Christophe Genolini a écrit : > Hi the list. > > I am writing a tutorial for my student using LaTeX and sweave. I > include > some example that work (obiously) but I would also like to include > some > example that do NOT work (for pedagogie)... > Is it possible ? > > At this point, I find that : > - if there is a error in the code, Sweave stop > - if I put the error in try(), Sweave compile but does not print the > error as output. > > Any solution ? > > Thanks a lot > > Christophe
Something along these lines should do what you want: <<echo=TRUE, eval=FALSE>>= TRUE <- 3 @ <<echo=FALSE, eval=TRUE>>= cat(try(TRUE <- 3)) @ If I recall correctly, this was discussed here before. HTH --- Vincent Goulet, Associate Professor École d'actuariat Université Laval, Québec [EMAIL PROTECTED] http://vgoulet.act.ulaval.ca ______________________________________________ R-help@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.