Skip to content

Feature enhancement: Allow for changes to tables #61

@carrollrm

Description

@carrollrm

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions