applyop - apply a function to specified operand(s) of an expression
|
Calling Sequence
|
|
applyop( f, i, e )
applyop( f, i, e, ..., xk, ...)
|
|
Parameters
|
|
f
|
-
|
function
|
i
|
-
|
specifies the operand(s) in e
|
e
|
-
|
expression
|
x[k]
|
-
|
optional arguments to f
|
|
|
|
|
Description
|
|
•
|
The applyop command manipulates the selected parts of an expression. The first argument, f, is applied to the operands of e specified by i.
|
•
|
If i is an integer, applyop( f, i, e) applies f to the ith operand of e. This is equivalent to subsop( i = f(op( i, e)), e). For example, if the value of e is the sum , applyop( f, 2, e) computes .
|
•
|
If i is a list of integers, the call applyop( f, i, e) is equivalent to subsop( i = f(op( i, e)), e). This allows you to manipulate any suboperand of an expression.
|
•
|
If i is a set, f is applied simultaneously to all operands of e specified in the set. Note: applyop( f, {}, e) returns e.
|
•
|
Any additional arguments xk are passed as additional arguments to f in the order given.
|
|
|
Examples
|
|
>
|
|
| (1) |
>
|
|
| (2) |
>
|
|
| (3) |
>
|
|
| (4) |
>
|
|
| (5) |
>
|
|
| (6) |
>
|
|
| (7) |
>
|
|
| (8) |
To expand the argument to the logarithm in e:
>
|
|
| (9) |
To factor the argument to the logarithm in e over R:
>
|
|
| (10) |
|
|
Download Help Document
Was this information helpful?