Skip to content

Commit

Permalink
Comment out syntax options in geom_function() (#5676)
Browse files Browse the repository at this point in the history
  • Loading branch information
teunbrand authored Feb 27, 2024
1 parent 7396a5d commit aec56e3
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 16 deletions.
16 changes: 8 additions & 8 deletions R/geom-function.R
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,14 @@
#' geom_function(aes(colour = "t, df = 1"), fun = dt, args = list(df = 1))
#'
#' # Using a custom anonymous function
#' base + geom_function(fun = function(x) 0.5*exp(-abs(x)))
#'
#' base + geom_function(fun = ~ 0.5*exp(-abs(.x)))
#'
#' # Using a custom named function
#' f <- function(x) 0.5*exp(-abs(x))
#'
#' base + geom_function(fun = f)
#' base + geom_function(fun = function(x) 0.5 * exp(-abs(x)))
#' # or using lambda syntax:
#' # base + geom_function(fun = ~ 0.5 * exp(-abs(.x)))
#' # or in R4.1.0 and above:
#' # base + geom_function(fun = \(x) 0.5 * exp(-abs(x)))
#' # or using a custom named function:
#' # f <- function(x) 0.5 * exp(-abs(x))
#' # base + geom_function(fun = f)
#'
#' # Using xlim to restrict the range of function
#' ggplot(data.frame(x = rnorm(100)), aes(x)) +
Expand Down
16 changes: 8 additions & 8 deletions man/geom_function.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit aec56e3

Please sign in to comment.