if(interactive()){
if (FALSE) {
n <- 100
dat <- data.frame(
A = rnorm(n), B = rnorm(n), C = rnorm(n),
D = rnorm(n), E = rnorm(n)
)
m2d <- data.frame(
cov = with(dat, c(cov(A,B), cov(A,C), cov(B,D), cov(D,E), cov(A,E))),
measure_1 = 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_plots(measures=m2d, data=dat)
# only one measure
m <- m2d[,1]
names(m) <- row.names(m2d)
nav <- l_ng_plots(measures=m, data=dat)
m2d[c(1,2),1]
# one d 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_plots(m1d, dat)
## more involved
q1 <- function(x)as.vector(quantile(x, probs=0.25))
# be careful that the vector names are correct
nav <- l_ng_plots(sapply(oliveAcids, q1), oliveAcids)
}
}
Run the code above in your browser using DataLab