-
Notifications
You must be signed in to change notification settings - Fork 26
Description
Hello,
I am interested in producing a slightly altered table output for labelled variables.
Specifically, I would like the option to remove the NA row and include the numeric values in addition to the labels.
I'm able to rewrite the function as:
tableVisual2 <- function(v, vnam, doEval = TRUE) {
x <- table(v)#, useNA = "always")
x <- t(rbind(x, paste(round(rbind(x/length(v)),4)*100, "%", sep = "")))
x <- cbind(dimnames(x)[[1]],as.numeric(attr(v, "labels")), x)
rownames(x) <- NULL
dimnames(x)[[2]] <- c("Label","Value", "Count", "Percentage")
thisCall <- call("pander", x = x, keep.trailing.zeros = TRUE)
if (!doEval) return(deparse(thisCall))
else return(eval(thisCall))
}
However, I would like the ability to use this altered function in conjunction with makeCodebook.
Thanks!
Rachel