% Generated by roxygen2: do not edit by hand
\name{function}
\alias{function}
\title{Function Definition}
\details{
A simple function
\code{
f <- function(name) {
  message <- paste("hello", name)
  print(message)
}

f("beautiful")
}

By default, the value of the last evaluated expression is returned
\code{
f <- function(x) {
  if (x < 0) return(0)
  x
}

f(-1)
f(1)
}

As of R 4.1.0, there is shorthand for inline function definition
\code{
f <- \(x) x^2
f(1:10)
}}

