This function does the element wise sum of two vectors.

my_sum(a, b)

Arguments

a

An integer() or numeric() vector of length L.

b

An integer() or numeric() vector of length L.

Value

An integer() or numeric() vector of length L with the element-wise sum of a and b.

Details

It really is just an example function that is powered by the + operator from base::Arithmetic.

Examples

## Generate some input data
x <- 1:10
y <- 1:10

## Perform the element wise sum
my_sum(x, y)
#>  [1]  2  4  6  8 10 12 14 16 18 20