R Function

R Function

An R function is a reusable block of code in the R programming language that performs a specific task. Functions accept inputs (called arguments), execute a set of instructions, and return an output. They are fundamental to writing efficient, readable, and maintainable R code.