<- function(arg1){
myFunction print("I will now multiply you input with 5.")
<- arg1 * 5
result return(result)
}
<- myFunction(arg1 = 8) a
[1] "I will now multiply you input with 5."
a
[1] 40
<- function(arg1){
myFunction print("I will now multiply you input with 5.")
<- arg1 * 5
result return(result)
}
<- myFunction(arg1 = 8) a
[1] "I will now multiply you input with 5."
a
[1] 40
If you need examples, all R package source codes consist of functions: https://github.com/r-spatial/sf/tree/master/R
rmse
that calculates the Root Mean Squared Error.= c(2,5,3,4)
x = c(2,6,5,5) y
calcNDVI
that calculates the NDVI.