| distance | R Documentation | 
Calculate the distance correlation between two linear spaces.
distance(s1, s2, type = "dist", x = NULL)
s1 | 
 First space  | 
s2 | 
 Second space  | 
type | 
 Type of distance measures:   | 
x | 
 The covariate values, for canonical correlation only.  | 
The distance between s1 and s2.
# two spaces
failEDR <- as.matrix(cbind(
  c(1, 1, 0, 0, 0, 0),
  c(0, 0, 1, -1, 0, 0)
))
B <- as.matrix(cbind(
  c(0.1, 1.1, 0, 0, 0, 0),
  c(0, 0, 1.1, -0.9, 0, 0)
))
distance(failEDR, B, "dist")
distance(failEDR, B, "trace")
N <- 300
P <- 6
dataX <- matrix(rnorm(N * P), N, P)
distance(failEDR, B, "canonical", dataX)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.