Closed Beduiz closed 1 year ago
Thanks for asking this. I am interested in this option too.
Same here
Hi Everyone,
I was able to figure out how to do this based on an example posted here:
https://cran.r-project.org/web/packages/table1/vignettes/table1-examples.html
It's the last modification demonstrated in Example 1.
@EpiPenny: you are quite right, this is a perfectly valid solution. But I think that what users would like is an easier way to do this. I've pushed a solution in b27cd6d. Basically, instead of just specifying a label like overall="Overall"
, if you want it to be on the left you give it the name "left", like this: overall=c(left="Overall")
.
Hi,
Thanks for responding to this question!!! That definitely seems like a more straightforward solution. However, when I tried it, the overall column still printed on the right. Below is my code. Did I misunderstand how to implement your suggestion, or might the problem be related to using an older version of the package?
#Table 1
table1(~ earlycare_f + mage5yr_fa + mraceeth_f + smoke_f |
preterm_f,
data = birthsfin,
overall=c(left="All Births"),
render.categorical = "Freq (PCTnoNA%)",
render.missing = "Freq",
big.mark = ",",
#This makes caption bold in html but not not word
caption = "<b>Table 1. Characteristics of a Cohort of U.S., Singleton, Live Births by Preterm Birth Status Based on the 2006 U.S. Birth Certificate Data\u{1D43}</b>",
#This works for viewer, but not for exporting to word (use add_footer_lines for Word)
footnote = c("\u{1D43}Only births reported on the 2003 revised U.S. Standard Birth Certificate were eligible",
"\u{1D47}Preterm birth includes live births that occurred at gestational ages 21-36 weeks inclusive")
)
Thanks!!!
Hi @EpiPenny. In order to try this out prior to the CRAN release, you need to install the "development" version using the remotes
package:
remotes::install_github("benjaminrich/table1")
Let me know if that works. Thanks.
This has been implemented in CRAN release 1.4.3.
Hi,
I tried it, and it worked perfectly!
Thanks so much for addressing this!
Dear Benjamin,
It would be great if there was an option to position the overall column, just like the extra.col can be positioned with extra.col.pos. I tried with overall.pos = 1, but it didnt respond, and I also couldnt find this in the documentation, so I assume it is not a feature as of now?
Kind regards Eric