-
Notifications
You must be signed in to change notification settings - Fork 66
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
function pander
when nested in another function in a knit chunk does not cat output.
#142
Comments
To quote a classic: this is a feature, not a bug :) But besides joking, This added functionality simply identifies if To disable this stuff, please add Not sure if this resolves the issue (BTW thank you very much for the detailed report), and I would be more than happy to hear any suggestions on how to overcome the described problem automatically. |
@mathematicalcoffee do you agree that the above described "disable |
Yes, it does. Thanks for the explanation, I wondered if it was something like that. I'm perfectly happy to set knitr.auto.asis to F (I hadn't noticed that feature, pretty cool). Thanks! |
Sounds great, thanks for the prompt and kind feedback. I'm closing this issue now, but please feel free to reopen/submit a new one if you come up with a better solution |
Reproduced this with pander 0.5.1 (on CRAN) and then again with 0.5.2 (using
install_github
), and knitr 1.8 (from CRAN).I have a function which uses
pander
to print a model.This works as expected:
This doesn't (it produces just the paragraph "Next paragraph", omitting the
pander(x)
output)To fix it you have to surround the
pander
call incat
:Then you get both the
pander(x)
output and the next paragraph.Bug
According to
?pander
I shouldn't have to surround thepander
call incat
.Note
pander(x)
call is the last statement of the function, then the result is printed. Or if you storeoutput = pander(x)
andreturn(output)
. That is, if the output ofpander(x)
happens to be the value returned bymyprint
, it will be printed. However, since I'm printing additional output after thepander
call, I cannot ensure that thepander
call comes last (or it prints out of order).myprint(x)
from the console I'll get the expected output. It's only once I callmyprint
from aknit
chunk. And thepander(x)
call has to be inside another function such asmyprint
; if I simply put the body of the function in aknit
chunk it all works.The text was updated successfully, but these errors were encountered: