Computes the variance along the specified axes.
Arguments
- x
(
arrayish)
Input array.- axes
(
integer()|NULL)
Axes to reduce. Negative values count from the end, i.e.-1refers to the last axis. IfNULL(default), reduces over all axes, returning a scalar.- drop
(
logical(1))
Whether to drop reduced axes.- correction
(
integer(1))
Degrees of freedom correction. Default is1(Bessel's correction).- nan_rm
(
logical(1))
How to handleNaNvalues in floating-point inputs. IfFALSE(default),NaNpropagates. IfTRUE,NaNvalues are skipped.
Value
arrayish
Has the same data type as the input.
When drop = TRUE, the reduced axes are removed.
When drop = FALSE, the reduced axes are set to 1.
Details
Uses Bessel's correction by default (correction = 1), matching R's var().
Set correction = 0 for population variance.