ProjectMOSAIC / ggformula

Provides a formula interface to 'ggplot2' graphics.
Other
39 stars 11 forks source link

panel.lmbands() #90

Closed nicholasjhorton closed 6 years ago

nicholasjhorton commented 6 years ago

Is there an easy way to replicate the functionality of panel.lmbands() for ggformula plots? This is used several times in some of the mosaic materials.

xyplot(age ~ cesd, panel = panel.lmbands, data = HELPrct)

screen shot 2018-06-04 at 3 44 57 pm
nicholasjhorton commented 6 years ago

My proposal would be to include examples of how to create this functionality using broom::augment() and not craft a separate layer for this.

rpruim commented 6 years ago

This exists already:

library(ggformula)
#> Loading required package: ggplot2
#> 
#> New to ggformula?  Try the tutorials: 
#>  learnr::run_tutorial("introduction", package = "ggformula")
#>  learnr::run_tutorial("refining", package = "ggformula")
library(mosaicData)
gf_point(length ~ width, data = KidsFeet) %>%
  gf_lm(interval = "confidence", fill = "red") %>%
  gf_lm(interval = "prediction", fill = "navy")

Created on 2018-06-15 by the reprex package (v0.2.0).

nicholasjhorton commented 6 years ago

This looks great. Could it be added to the vignette? https://cran.r-project.org/web/packages/ggformula/vignettes/ggformula.html

rpruim commented 6 years ago

I've added something. But I'm not sure the point of the vignette is to show every possible thing that can be done.

I've put this in the section on stats since these are using statistical transformations of the data.