Let's pretend that:
f <- function(x) x + 1 comment(f) <- "my function" f(3)
Arguments We distinguish between formal arguments and actual arguments. The above x has a formal argument f . The formal argument names f are given as follows:
> names(formals(f)) [1] "x"
Actual function arguments vary from one call to another, and in the example above there is one actual argument 3 .
The args function can be used to display the entire functional signature of the function, including formal arguments and default arguments, and if you are debugging the function, you can enter match.call() to list the signature of the function with the actual arguments replaced.
Attributes The attributes of an object R are defined using attributes(f) as follows:
> attributes(f) $srcref function(x) x + 1 $comment [1] "my function"
There is one exception, and that the class of the object is also considered as an attribute, but not specified above, but the class is specified:
> class(f) [1] "function"
Parameters Sometimes function arguments are called parameters, or sometimes they refer to those arguments that are fixed as parameters, but this is usually more related to math and statistics than R.
In statistical models, the model usually depends on the data and model parameters, often in probability. For example, here:
> lm(demand ~ Time, BOD) Call: lm(formula = demand ~ Time, data = BOD) Coefficients: (Intercept) Time 8.521 1.721
coefficients of linear regression of interception and time (t. 8.521 and 1.721) are often referred to as model parameters.
As Dwin already pointed out, various values that affect the graphics in R are also called parameters and can be displayed through:
> par()
and related concepts in other R-graphics systems are also often referred to as parameters.