# Generate data
n <- 50
set.seed(123456)
x <- sdetorus::toPiInt(rbind(
mvtnorm::rmvnorm(n = n, mean = c(-pi, -pi) / 2,
sigma = diag(0.1, nrow = 2)),
mvtnorm::rmvnorm(n = n, mean = c(-3 * pi / 2, 0) / 2,
sigma = diag(0.1, nrow = 2)),
mvtnorm::rmvnorm(n = n, mean = c(0, pi / 2),
sigma = diag(0.1, nrow = 2))
))
col <- rainbow(3)[rep(1:3, each = n)]
# Torus pairs
torus_pairs(x, col_data = col)
# \donttest{
fit <- ridge_pca(x = x)
torus_pairs(fit$scores, col_data = col)# }
Run the code above in your browser using DataLab