R, basic function

addition = function(num1,num2){
answer = num1+num2
return(answer)
}
addition(10,9)
addition(5,4)

Thanks Isaac!

 

Use "" if dealing with a string.

addition = function(x1){
x1 = 2+3
return(x1)
}
addition(”kaz”)
addition(”john”)

Leave a Reply