@@ -170,8 +170,8 @@ ggplot2::ggplot_add
170170# ' vignette("infer")
171171# ' }
172172# '
173- # ' @importFrom ggplot2 ggplot geom_histogram aes ggtitle
174- # ' @importFrom ggplot2 xlab ylab geom_vline geom_rect geom_bar
173+ # ' @importFrom ggplot2 ggplot geom_histogram aes
174+ # ' @importFrom ggplot2 geom_vline geom_rect geom_bar labs
175175# ' @importFrom stats dt qt df qf dnorm qnorm dchisq qchisq
176176# ' @export
177177visualize <- function (
@@ -651,7 +651,7 @@ redraw_theory_layer <- function(plot, mean_shift, sd_shift) {
651651}
652652
653653
654- title_layer <- function (data , title_fn = ggplot2 :: ggtitle ) {
654+ title_layer <- function (data , title_fn = function ( x ) labs( title = x ) ) {
655655 method <- get_viz_method(data )
656656 theory_type <- short_theory_type(data )
657657
@@ -691,9 +691,9 @@ labels_layer <- function(data, term) {
691691 x_lab <- switch (method , simulation = " {term}" , " {theory_type} stat" )
692692 y_lab <- switch (method , simulation = " count" , " density" )
693693
694- list (
695- xlab( glue(x_lab , .null = " NULL" ) ),
696- ylab( glue(y_lab , .null = " NULL" ) )
694+ labs (
695+ x = glue(x_lab , .null = " NULL" ),
696+ y = glue(y_lab , .null = " NULL" )
697697 )
698698}
699699
@@ -749,7 +749,7 @@ get_viz_bins <- function(data) {
749749
750750# ' @method ggplot_add infer_layer
751751# ' @export
752- ggplot_add.infer_layer <- function (object , plot , object_name ) {
752+ ggplot_add.infer_layer <- function (object , plot , ... ) {
753753 # a method for the `+` operator for infer objects.
754754 # - "object to add" (arguments to the RHS of the `+`)
755755 # - plot is the existing plot (on the LHS of the `+`)
0 commit comments