Hi@akhtar,
We can create user-defined functions in R. They are specific to what a user wants and once created they can be used as the built-in functions. Below is an example of how a function is created and used.
new.function <- function(a) {
for(i in 1:a) {
b <- i^2
print(b)
}
}
Hope this helps!
To know more, join R programming course today.
Thanks.