inst/expkg/rcw/rcw-test.R

# load function

source('rcw-code.R', local=TRUE)

# create matrix to test rotation

mx <- matrix(c(1:3, rep(0, 6)), 3)

rcw(mx)

# full rotation should get us to original

identical(mx, rcw(rcw(rcw(rcw(mx)))))

# non-square matrix

mx2 <- matrix(c(1:3, rep(0, 3)),  ncol=2)
rcw(mx2)

# Invalid input

rcw(1:10)

Try the unitizer package in your browser

Any scripts or data that you put into this service are public.

unitizer documentation built on Oct. 8, 2023, 5:06 p.m.