dotproduct: Computes the dot product of two iterable objects.

View source: R/dotproduct.R

dotproductR Documentation

Computes the dot product of two iterable objects.

Description

Returns the dot product of two numeric iterables of equal length

Usage

dotproduct(vec1, vec2)

Arguments

vec1

the first

vec2

the second iterable object

Value

the dot product of the iterators

Examples

it <- iteror(1:3)
it2 <- iteror(4:6)
dotproduct(it, it2) # 32

it <- iteror(1:4)
it2 <- iteror(7:10)
dotproduct(1:4, 7:10) # 90


iterors documentation built on May 31, 2023, 5:36 p.m.