

Matrix with a column corresponding to each element of X. Length is one the result is a vector, and if greater than one is a Of X are all of the same (positive) length. Length greater than zero and if the return values from all elements Simplification in sapply is only attempted if X has That a sensible error message is given if arguments named X or Through: this both avoids partial matching to FUN and ensures In general-purpose code it is good practice to name theįirst two arguments X and FUN if. Other arguments, and care may be needed to avoid partial matching toįUN. Will always be passed a length-one vector of the same type as X.Īrguments in. Is specified as a function or a symbol (e.g., a backquoted name) or aĬharacter string specifying a function to be searched for from theįunction FUN must be able to accept as input any of theĮlements of X.

These two cases correspond to sapply(*, simplify = "array") orįUN is found by a call to match.fun and typically Higher = FALSE would return a matrix (or vector) only.
.png)
(“higher rank”) array when appropriate, whereas Logical if true, simplify2array() will produce a The expression (a language object, usually a call)Ī list, typically returned from lapply(). its name cannotĪ (generalized) vector a template for the return Use X as names for the result unless it had namesĪlready. ( = length(dim(.))) one higher than the result Whereas if simplify = "array" the result may be an The default value, TRUE, returns a vector or matrix if appropriate, Possible? For sapply it must be named and not abbreviated. Simplified to a vector, matrix or higher dimensional array if Logical or character string should the result be +, %*%, the function name must be backquoted or quoted. The function to be applied to each element of X: Other objects (including classed objects) will be coerced , USE.NAMES = TRUE ) replicate ( n, expr, simplify = "array" ) simplify2array ( x, higher = TRUE )Ī vector (atomic or list) or an expression , simplify = TRUE, USE.NAMES = TRUE ) vapply ( X, FUN, FUN.VALUE.
