Computes the variance along the specified dimensions.
Arguments
- operand
(
arrayish)
Operand.- dims
(
integer()|NULL)
Dimensions to reduce. IfNULL(default), reduces over all dimensions, returning a scalar.- drop
(
logical(1))
Whether to drop reduced dimensions.- 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 dimensions are removed.
When drop = FALSE, the reduced dimensions are set to 1.
Details
Uses Bessel's correction by default (correction = 1), matching R's var().
Set correction = 0 for population variance.