jamovi / jmv

jamovi for R
https://www.jamovi.org
56 stars 27 forks source link

How to access and/or modify graphics within the R6 object #324

Closed brianmsm closed 2 years ago

brianmsm commented 2 years ago

I'm not sure if this would be the right place for this. I was wondering what would be the way to be able to modify a chart that is generated with some function of the jmv package. For example, modify general chart colors or use ggsave to control export parameters from R.

results <- jmv::descriptives(
  data = mtcars,
  vars = vars(mpg, cyl, disp),
  hist = TRUE)

plots <- results$plots

plots

Created on 2021-11-23 by the reprex package (v2.0.1)

jonathon-love commented 2 years ago

i think using your example, you can get a ggplot object as follows:

ggplotobject <- plots[[1]]$items$hist$plot$fun()

cheers

brianmsm commented 2 years ago

Great! That's what I wanted. Thank you very much!

I will close this issue.