r语言中自定义函数的使用
Aim: To create user-defined function in R to find maximum of three numbers.
目的:在R中创建用户定义的函数,以查找最多三个数字。
Syntax:
句法:
To create function in R following syntax is used:
要在R中创建函数,请使用以下语法:
Function-name=function(parameter)
{
#body of function
}
Where,
哪里,
Function-name is the name of user-defined function.
Function-name是用户定义函数的名称。
function is the keyword which is used in R to create function
function是R中用来创建函数的关键字
#body of function basically defines the property of function.
#body函数基本上定义了函数的属性。
Code: