@@ -170,8 +170,8 @@ ggplot2::ggplot_add
170
170
# ' vignette("infer")
171
171
# ' }
172
172
# '
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
175
175
# ' @importFrom stats dt qt df qf dnorm qnorm dchisq qchisq
176
176
# ' @export
177
177
visualize <- function (
@@ -651,7 +651,7 @@ redraw_theory_layer <- function(plot, mean_shift, sd_shift) {
651
651
}
652
652
653
653
654
- title_layer <- function (data , title_fn = ggplot2 :: ggtitle ) {
654
+ title_layer <- function (data , title_fn = function ( x ) labs( title = x ) ) {
655
655
method <- get_viz_method(data )
656
656
theory_type <- short_theory_type(data )
657
657
@@ -691,9 +691,9 @@ labels_layer <- function(data, term) {
691
691
x_lab <- switch (method , simulation = " {term}" , " {theory_type} stat" )
692
692
y_lab <- switch (method , simulation = " count" , " density" )
693
693
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" )
697
697
)
698
698
}
699
699
@@ -749,7 +749,7 @@ get_viz_bins <- function(data) {
749
749
750
750
# ' @method ggplot_add infer_layer
751
751
# ' @export
752
- ggplot_add.infer_layer <- function (object , plot , object_name ) {
752
+ ggplot_add.infer_layer <- function (object , plot , ... ) {
753
753
# a method for the `+` operator for infer objects.
754
754
# - "object to add" (arguments to the RHS of the `+`)
755
755
# - plot is the existing plot (on the LHS of the `+`)
0 commit comments