I have come to this concept many times, but the name is not known for it, so do not google to know it Could have more Actually, I will often see something like this while searching through the function or in other written general commands:
apply (dataset, 1: 2, function (x) 10 * x) < / Code>
In this case, I had to find out that by any means, this "mock function" will only multiply each element of the dasसेट of function (x) 10 . Like a useful feature, but I'm still not sure when or how you use it. Is this really a celebration? Or does it work to implement the family of this function? What is the name of this thing?
They are called "anonymous tasks", and yes they are real function objects, which only use No symbols have been assigned before being made.
There is a bit related to:
Normally the function is assigned to symbols but they are not required to be paid by the call given to the function There is a function if it is not given a name, then it is called an anonymous function. Anonymous functions are often used in the form of logic to implement other functions such as family or external
Although they are most commonly applied to * < / Code> are used in functions, they do not need, as can be seen here, for example
(function (x, y) {x * y + x / Y}} (2,5) # [1] 10.4
Comments
Post a Comment