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

rendering ggplot in html output #351

Open
vjd opened this issue Jan 6, 2020 · 5 comments
Open

rendering ggplot in html output #351

vjd opened this issue Jan 6, 2020 · 5 comments
Labels

Comments

@vjd
Copy link

vjd commented Jan 6, 2020

I am using RCall in .jmd file where I used the mtcars dataset to make a simple ggplot.

using RCall
mtcars = rcopy(R"mtcars")
R"""
(p <- ggplot(mtcars, aes(drat, wt)) + geom_point())
"""

What do I need to do to get this rendered in the html file that is weaved? This the output I get

image

Obviously, just printing p in the julia chunk throws an error. Am I missing something?

@palday
Copy link
Collaborator

palday commented Mar 4, 2020

Possible duplicate of #340

@awellis
Copy link

awellis commented Apr 4, 2020

What should happen if you call

R"""
ggplot(mtcars, aes(drat, wt)) + geom_point()
"""

in a jmd file? In a Jupyter notebook, the resulting figure is shown. I cannot get this to work in a Julia markdown file, though.

@vjd
Copy link
Author

vjd commented Apr 4, 2020

in the interactive mode in a jmd file, it will produce an external window where the ggplot2 is rendered. But when you weave the document, it does not render.

@awellis
Copy link

awellis commented Apr 4, 2020

It certainly renders, but is there no way to get the output included in the weaved markdown file?

@awellis
Copy link

awellis commented Apr 4, 2020

doing this has the same result:

using RCall, DataFrames

d = DataFrame(v = [3,4,5], w = [5,6,7], x = [1,2,3], y = [4,5,6], z = [1,1,2])
ggplot(d, aes(x=:x,y=:y)) + geom_line()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants