-
-
Notifications
You must be signed in to change notification settings - Fork 48
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
Fix the "two chunk" requirement for rendering ggMarginalPlots in RMarkdown docs #148
Conversation
…ts in RMarkdown docs (closes daattali#147).
With this solution, should a notebook file containing this chunk
produce the plot? |
It shoulllld. Does it? |
Not for me. Does it work for you? Is there any other way to test this PR? |
Yeah, so this is probably a mac v windows thing. Not sure where we go from here. The current two chunk solution works across all platforms and doesn't produce the leading page. The solution in this PR seems to work on osx (at least in my env) and doesn't work on WIndows. We could compare RStudio/ggplot2 versions, but I'm not sure if that would provide more clarity. I'm willing to say "this one-chunk solution seems to work in some cases" in the readme, and tell users to fallback to the two-chunk alternative. It's kinda a wash for me, though. Thoughts, @daattali and @IndrajeetPatil ? |
If we merge this PR, it will fix the issue in some situations. Is there also any regressions or other changed behaviour you expect? |
None that I could see.
…On Tue, Aug 20, 2019 at 1:33 AM Dean Attali ***@***.***> wrote:
If we merge this PR, it will fix the issue in some situations. Is there
also any regressions or other changed behaviour you expect?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#148?email_source=notifications&email_token=ACVTOOITTZDN6PUU2FRNAZDQFN64BA5CNFSM4INLKDYKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD4VDN4Q#issuecomment-522860274>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ACVTOOKIGYGRMU34X6JRXT3QFN64BANCNFSM4INLKDYA>
.
|
Thanks for all the hard work - I'm sure the time it took to come up with these few lines is not proportional to the number of lines you added. And thanks for your detailed message too - the answer to # 3 was especially informative :) |
Thank you so much for all your work and understanding!! Do you plan to submit the newer version to CRAN any time soon? |
@daattali , what are your thoughts on releasing a new version? I think you have to be the one to submit to CRAN b/c you're the maintainer. |
I'll work on submitting to CRAN soon, thanks for your patience! |
Package has been submitted |
This PR provides my best attempt at solving #147. It has the issue of the leading blank page that I mentioned in that issue thread, though other than that it pretty much gets the job done. I'll update the README once/if this PR gets the all clear. A few questions that may cross your mind:
ggMarginalPlot
into aggplot
, regardless of whether the plotting code is evaluated in an RMarkdown doc? I.e., why not just always use lines https://github.com/daattali/ggExtra/compare/master...crew102:ggmarginals-in-rmarkdown?expand=1#diff-01bed624663254513627969554598880R206-R210?If we convert to a ggplot object, we end up with a leading blank page when plotting to non-interactive devices. This can be fixed by using
ggsave()
instead of following the workflow of opening up a graphics device, plotting, then closing the device, but that would require people change all their code that writesggMarginalPlot
s to files.Yes, the two chunks approach will still produce the same results as it always has. This is still the only way to avoid the leading blank page when running a chunk semi-interactively (i.e., when pressing the "run current chunk" button).
ggExtraPlot
/gtable
object returned byggMarginal()
into aggplot
to address the issues mentioned in Rendering inline in rstudio #89 and https://support.rstudio.com/hc/en-us/community/posts/239529128-Notebooks-grid-newpage?No idea.
ggMarginalPlot
to aggplot
somehow provide the functionality desired in any possibility of not changing class of plots #129?I don't think so, though I didn't take a very close look. Essentially when you convert the
ggMarginalPlot
to aggplot
, the entire plot (including the marginal plots) are considered the plot. So, for example, if you tried to change the theme of the plot, it would change the theme of the scatter plot and the marginal plots. It may be possible to pull out the scatter plot and manipulate it on its own, but I don't think that's @IndrajeetPatil was going for in #129.