if (interactive()){
# Simple example with generated data
n <- 100
dat <- data.frame(
A = rnorm(n), B = rnorm(n), C = rnorm(n),
D = rnorm(n), E = rnorm(n)
)
m2d <- data.frame(
cor = with(dat, c(cor(A,B), cor(A,C), cor(B,D), cor(D,E), cor(A,E))),
my_measure = c(1, 3, 2, 1, 4),
row.names = c('A:B', 'A:C', 'B:D', 'D:E', 'A:E')
)
# or m2d <- as.matrix(m2d)
nav <- l_ng_ranges(measures=m2d, data=dat)
# With 1d measures
m1d <- data.frame(
mean = sapply(dat, mean),
median = sapply(dat, median),
sd = sapply(dat, sd),
q1 = sapply(dat, function(x)quantile(x, probs=0.25)),
q3 = sapply(dat, function(x)quantile(x, probs=0.75)),
row.names = names(dat)
)
nav <- l_ng_ranges(m1d, dat)
}
Run the code above in your browser using DataLab