```
## independent multivariate data
x <- matrix(rnorm(60), nrow=20, ncol=3)
y <- matrix(rnorm(40), nrow=20, ncol=2)
indep.test(x, y, method = "dcov", R = 99)
indep.test(x, y, method = "mvI", R = 99)
## Not run:
# ## dependent multivariate data
# if (require(MASS)) {
# Sigma <- matrix(c(1, .1, 0, 0 , 1, 0, 0 ,.1, 1), 3, 3)
# x <- mvrnorm(30, c(0, 0, 0), diag(3))
# y <- mvrnorm(30, c(0, 0, 0), Sigma) * x
# indep.test(x, y, R = 99) #dcov method
# indep.test(x, y, method = "mvI", R = 99)
# }
# ## End(Not run)
## Not run:
# ## compare the computing time
# x <- mvrnorm(50, c(0, 0, 0), diag(3))
# y <- mvrnorm(50, c(0, 0, 0), Sigma) * x
# set.seed(123)
# system.time(indep.test(x, y, method = "dcov", R = 1000))
# set.seed(123)
# system.time(indep.test(x, y, method = "mvI", R = 1000))
# ## End(Not run)
```

Run the code above in your browser using DataLab