Skip to contents

tda_mcross is TDA's mcross, matching base R's crossprod(A) (t(A) %*% A). tda_mnum builds the length-n arithmetic sequence starting at x with step d – TDA's mnum, matching seq(x, by = d, length.out = n).

Usage

tda_mcross(A, dir = tempfile("tda"))

tda_mnum(x, d, n, dir = tempfile("tda"))

Arguments

A

a numeric matrix.

dir

working directory.

x

the starting value, for tda_mnum.

d

the step, for tda_mnum.

n

the length, for tda_mnum.

Value

tda_mcross returns a matrix; tda_mnum returns a plain numeric vector.

Examples

tda_mcross(matrix(1:6, 3, 2))    # == crossprod(matrix(1:6, 3, 2))
#>      [,1] [,2]
#> [1,]   14   32
#> [2,]   32   77
tda_mnum(5, 2, 4)                # == seq(5, by = 2, length.out = 4)
#> [1]  5  7  9 11