Elementwise application of a function to a matrix expression
Source:R/matexpr-core.R
ElementwiseApplyFunction.RdElementwiseApplyFunction(fun, expr) applies a scalar function to every
entry of the matrix expr, as SymPy's expr.applyfunc(fun) does for a
matrix expression. fun is an R function of one argument or a
Lambda(); it is kept as a Lambda. The result prints as
Lambda(_d, f(_d)).(expr).
Examples
k <- Symbol("k")
X <- MatrixSymbol("X", k, k)
ElementwiseApplyFunction(sin, X)
#> Lambda(_d, sin(_d)).(X)