Skip to content
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

knit_child and blocks producing multiple plots #824

Closed
kforner opened this issue Jul 31, 2014 · 4 comments
Closed

knit_child and blocks producing multiple plots #824

kforner opened this issue Jul 31, 2014 · 4 comments
Labels
bug Bugs
Milestone

Comments

@kforner
Copy link
Contributor

kforner commented Jul 31, 2014

just for reference: cf r-lib/evaluate#36

example:
parent.Rnw

\documentclass[letter, margin=1.90cm, 12pt]{scrartcl}
\begin{document}

<<parent_call_child, message = FALSE, include = FALSE, results = 'asis', eval = TRUE>>=
library(ggplot2)
out <- knitr::knit_child('child.Rnw', options = list(fig.keep='all'))
@
\Sexpr{paste(out, collapse="\n")}
\end{document}

child.Rnw

\section{PLOTS}
<<plots_for_loop, message = FALSE, echo = FALSE, results = 'asis', fig.keep = 'all', fig.show = 'asis', eval = TRUE>>=
{
  print(ggplot(iris, aes(x = Species)) + geom_histogram(fill = 'green') + ggtitle(paste('PLOT CHILD 1')))
  print(ggplot(iris, aes(x = Species)) + geom_histogram(fill = 'green') + ggtitle(paste('PLOT CHILD 2')))
}
@

When you knit it, I only get one plot.

@yihui
Copy link
Owner

yihui commented Aug 3, 2014

Thanks for the report. Since you have identified the problems, it will be great if you can submit pull requests to fix them :)

@yihui yihui added this to the v1.7 milestone Aug 3, 2014
@yihui yihui added the Bug label Aug 3, 2014
@kforner
Copy link
Contributor Author

kforner commented Aug 3, 2014

Sure, but not sure when. I'm in vacation right now...

@yihui
Copy link
Owner

yihui commented Aug 3, 2014

Okay, I'll take a look then.

@yihui yihui closed this as completed in 9073d08 Sep 1, 2014
@yihui yihui reopened this Sep 1, 2014
jsonn pushed a commit to jsonn/pkgsrc that referenced this issue Apr 17, 2016
Upstream changes:
Version 0.8.3
------------------------------------------------------------------------------

* Added an argument `filename` to evaluate() and parse_all() (thanks,
  @flying-sheep, #58).

Version 0.8
------------------------------------------------------------------------------

* Changed package license to MIT.

Version 0.7.2
------------------------------------------------------------------------------

* replay() fails to replay certain objects such as NULL (#53).

Version 0.7
------------------------------------------------------------------------------

* R 3.0.2 is the minimal required version for this package now.

Version 0.6
------------------------------------------------------------------------------

* Plots are no longer recorded when the current graphical device has been
  changed, which may introduce issues like yihui/knitr#824.

* `parse_all()` can parse R code that contains multibyte characters correctly
  now (#49, yihui/knitr#988)
@github-actions
Copy link

This old thread has been automatically locked. If you think you have found something related to this, please open a new issue by following the issue guide (https://yihui.org/issue/), and link to this old issue if necessary.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 10, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Bugs
Projects
None yet
Development

No branches or pull requests

2 participants