ProjectMOSAIC / mosaic

Project MOSAIC R package
http://mosaic-web.org/
93 stars 26 forks source link

mplot() feature request #778

Closed nicholasjhorton closed 3 years ago

nicholasjhorton commented 3 years ago

I love the use of mplot() for interactive graphics.

Any chance that the code from "Show Expression" could be indented on lines 2 - n?

gf_point(cesd ~ age, data = HELPrct) %>%
  gf_facet_wrap(~ sex, ncol = 4) %>% 
  gf_labs(title = "", caption = "")

instead of

gf_point(cesd ~ age, data = HELPrct) %>%
gf_facet_wrap(~ sex, ncol = 4) %>% 
gf_labs(title = "", caption = "")
rpruim commented 3 years ago

Probably. I'm hoping to squeeze a mosaic CRAN release in very soon. (ggformula is already there, and I just need to track down an issue with mosaicCore, and the mosaic is ready. Perhaps I can get this done for that release.

rpruim commented 3 years ago

So... the spaces were already there in the code, but { glue }'s trimming is more aggressive than I knew:

glue::glue("    A   \n   B   ")
## A   
## B   
glue::glue("    A   \n   B   ", .trim = FALSE)
##     A   
##    B 

I've added .trim = FALSE to all the calls. That should get us back the strings the way we had intended.

rpruim commented 3 years ago
gf_jitter(age ~ anysubstatus, data = HELPrct, color = ~ substance) %>%
  gf_facet_wrap(~ sex, ncol = 4) %>% 
  gf_theme(legend.position = "top") %>% 
  gf_labs(title = "", caption = "")

Should be good to go with next release.