Skip to content

Commit aec56e3

Browse files
authored
Comment out syntax options in geom_function() (#5676)
1 parent 7396a5d commit aec56e3

File tree

2 files changed

+16
-16
lines changed

2 files changed

+16
-16
lines changed

R/geom-function.R

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -42,14 +42,14 @@
4242
#' geom_function(aes(colour = "t, df = 1"), fun = dt, args = list(df = 1))
4343
#'
4444
#' # Using a custom anonymous function
45-
#' base + geom_function(fun = function(x) 0.5*exp(-abs(x)))
46-
#'
47-
#' base + geom_function(fun = ~ 0.5*exp(-abs(.x)))
48-
#'
49-
#' # Using a custom named function
50-
#' f <- function(x) 0.5*exp(-abs(x))
51-
#'
52-
#' base + geom_function(fun = f)
45+
#' base + geom_function(fun = function(x) 0.5 * exp(-abs(x)))
46+
#' # or using lambda syntax:
47+
#' # base + geom_function(fun = ~ 0.5 * exp(-abs(.x)))
48+
#' # or in R4.1.0 and above:
49+
#' # base + geom_function(fun = \(x) 0.5 * exp(-abs(x)))
50+
#' # or using a custom named function:
51+
#' # f <- function(x) 0.5 * exp(-abs(x))
52+
#' # base + geom_function(fun = f)
5353
#'
5454
#' # Using xlim to restrict the range of function
5555
#' ggplot(data.frame(x = rnorm(100)), aes(x)) +

man/geom_function.Rd

Lines changed: 8 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)