Jeevan Rai

My thoughts, opinions and experiences

How to write functions in R? The shortest version


Lets create a function to add two numbers in R

add <- function(a,b){
               a+b}

Thats it. 🙂

add(1,7)
[1] 8


Leave a Reply

Your email address will not be published. Required fields are marked *