We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hi, Is there a way to not to display the number of data points contributing to the summary for a category using Table1?
Current code is:
rndr <- function(x, name, ...){ f <- function(x){ if (is.na(x) || is.nan(x)) "NC" else signif_pad(x, 3) } Med = median(x, na.rm = T) Min = min(x, na.rm = T) Max = max(x, na.rm = T) N = length(na.omit(x)) MPI = paste0(f(Med), " [", f(Min), " - ", f(Max), "]", " (",f(N),")") Tmp <- switch(name, X = c("Median [Min - Max] (N)" = MPI), Y = c("Median [Min - Max] (N)" = MPI) ) parse.abbrev.render.code(c("", Tmp))(x) } dat <- read.table(header=T, sep="|", na.strings=".", strip.white=T, text=" ID | TYPE | QQ | X | Y 1 | aa | 1 | 0.13 | . 1 | aa | 2 | . | 1.2 1 | bb | 4 | 1.8 | . 1 | bb | 2 | . | 0.9 2 | aa | 1 | 0.17 | . 2 | aa | 2 | . | 2.1 2 | cc | 1 | 33 | . 2 | cc | 1 | . | 54 ") zebra = "Rtable1-zebra Rtable1-shade Rtable1-times" tab1 = table1( ~ X + Y | TYPE*QQ, data = dat, overall = F, render = rndr, caption = "", topclass = zebra, rowlabelhead = "") tab1
The text was updated successfully, but these errors were encountered:
Yes, it's possible. It might not be the most elegant code, but if you pass this argument inside the function call you should get what you want:
render.strat = function(label, ...) sprintf("<span class='stratlabel'>%s</span>", label),
I need to think about a nicer way of integrating this functionality.
Sorry, something went wrong.
Thanks so much for the quick response. It's one of the best packages! I am using it every day. Cheers
No branches or pull requests
Hi,
Is there a way to not to display the number of data points contributing to the summary for a category using Table1?
Current code is:
The text was updated successfully, but these errors were encountered: