One of R’s strengths is the ease of creating new functions. Objects in the function body remain local to the function, and any data type may be returned.
Here is an example user-created function:

f <- function(x, y) {

> f(1, 2)
[1] 11

> f(c(1,2,3), c(5,3,4))
[1] 23 18 25

> f(1:3, 4)
[1] 19 22 25
उदाहरण
Mandelbrot set
मूलभूत सिन्टैक्स
फ्ंक्शन की संरचना