# Nested Function
## Definition(s)
### Nexus: [[Nexus - Google Analytics Certificate Course]]
#### Topic: [[Google Analytics - 7 Data Analysis with R Programming - Module 2 - Programming using RStudio]]
>[! Definition]
>A function that is completely contained within another function
## Examples
```r
Outer_func <- function(x) {
Inner_func <- function(y) {
a <- x + y
return(a)
}
return (Inner_func)
}
output <- Outer_func(3) # To call the Outer_func
output(5)
```
Credit: [W3Schools.com example](https://www.w3schools.com/r/r_functions_nested.asp)
## Related
[[Nested|nested code]]
## Resources
## Flashcards
The below code are generated for use with [Spaced Repetition plugin](https://github.com/st3v3nmw/obsidian-spaced-repetition/) [docs](https://www.stephenmwangi.com/obsidian-spaced-repetition/)