You could modify the object norm.x
returned by sapply(x, sf.test)[1:2,]
with the functions unlist
and matrix
.
norm.x <- matrix(unlist(norm.x), nrow = 2, dimnames = list(c("w", "p-value")))
The complete code:
library("xtable")
library("Hmisc")
library("nortest")
set.seed(1)
x <- data.frame(replicate(10, rnorm(100)))
norm.x <- sapply(x, sf.test)[1:2,]
norm.x <- matrix(unlist(norm.x), nrow = 2, dimnames = list(c("w", "p-value")))
latex(norm.x, file="", dec=2)
xtable(norm.x)