sqsum {SETGEN}R Documentation

Sum of squares

Description

Calculate the sum of squares of the elements of a numeric vector.

Usage

sqsum(x)

Arguments

x A numeric vector.

Value

The sum of squared elements of x.

Author(s)

Beck, M.

Examples

x <- 1:5
sqsum(x) # 55
y <- rep(2,4)
sqsum(y) # 16

[Package SETGEN version 0.1 Index]