ggplot2-solutions icon indicating copy to clipboard operation
ggplot2-solutions copied to clipboard

Exercise 3.1.1.3 explanation

Open luifrancgom opened this issue 2 years ago • 0 comments

Dear Kangnade

I don´t understant how you where able fo find the answer for this exercise. How you where able to identidy that geom smooth() uses the geoms geom_point(), geom_path(), and geom_area(). I tried the following:

ggplot2::geom_smooth
#> function (mapping = NULL, data = NULL, stat = "smooth", position = "identity", 
#>     ..., method = NULL, formula = NULL, se = TRUE, na.rm = FALSE, 
#>     orientation = NA, show.legend = NA, inherit.aes = TRUE) 
#> {
#>     params <- list(na.rm = na.rm, orientation = orientation, 
#>         se = se, ...)
#>     if (identical(stat, "smooth")) {
#>         params$method <- method
#>         params$formula <- formula
#>     }
#>     layer(data = data, mapping = mapping, stat = stat, geom = GeomSmooth, 
#>         position = position, show.legend = show.legend, inherit.aes = inherit.aes, 
#>         params = params)
#> }
#> <bytecode: 0x5605a7ab6210>
#> <environment: namespace:ggplot2>

Created on 2022-08-22 by the reprex package (v0.3.0)

Also I tried:

ggplot2::GeomSmooth
#> <ggproto object: Class GeomSmooth, Geom, gg>
#>     aesthetics: function
#>     default_aes: uneval
#>     draw_group: function
#>     draw_key: function
#>     draw_layer: function
#>     draw_panel: function
#>     extra_params: na.rm orientation
#>     handle_na: function
#>     non_missing_aes: 
#>     optional_aes: ymin ymax
#>     parameters: function
#>     required_aes: x y
#>     setup_data: function
#>     setup_params: function
#>     use_defaults: function
#>     super:  <ggproto object: Class Geom, gg>

Created on 2022-08-22 by the reprex package (v0.3.0)

But I wasn´t able to see the geoms you pointed out.

Best wishes

luifrancgom avatar Aug 22 '22 19:08 luifrancgom