Element-wise square or power-2 operations on numeric or complex vectors (or objects which can be coerced to them).
Usage
# S3 method for default
square(x)
Arguments
- x
numeric or complex vectors or objects which can be coerced to such, or other objects for which methods have been written.
Details
square(x)
is equivalent to x^2
where ^
is the default power function,
i.e. \(x^2\).
From base::Arithmetic: if applied to arrays the result will be an array if this is sensible (for example it will not if the recycling rule has been invoked).