Learn R Programming

abd (version 0.1-21)

sum_of_squares: Sum of Squares and Sum of Products

Description

Calculate the sum of squares (sum_of_squares) or sum of products (sum_of_products) of a numeric vector or pair of numeric vectors

Usage

sum_of_squares(x)

sum_of_products(x, y)

Arguments

x
a vector of numeric values
y
a vector of numeric values

Value

  • a numeric value

Examples

Run this code
set.seed(4)
x <- rnorm(10)
sum_of_squares(x)

y <- rnorm(10)
sum_of_products(x, y)

Run the code above in your browser using DataLab