📜  r 中的自定义函数 - 无论代码示例

📅  最后修改于: 2022-03-11 15:00:56.541000             🧑  作者: Mango

代码示例1
# create custom function 

addition <- function(x) { 
y <- x + 1            
print(y) 

} 


z <- 2
addition(z)  # call new function on variable, z
> 3    # R returns the new value created by function