# Vector
set.seed(1)
v <- rnorm(100)
su(v, print = TRUE)
# Matrix: variables in columns
M <- cbind(x = rnorm(50), y = runif(50))
su(M)
# Matrix: variables in rows
Mr <- rbind(x = rnorm(50), y = runif(50))
su(Mr, mat.var.in.col = FALSE)
# Data frame
DF <- data.frame(a = rnorm(30), b = rexp(30), c = rbinom(30, 1, 0.3))
out <- su(DF)
head(out)
Run the code above in your browser using DataLab