table1 icon indicating copy to clipboard operation
table1 copied to clipboard

table1 align ignored

Open FelipeCarrillo opened this issue 2 years ago • 1 comments

I am trying to align a 'table1' to the center but the align = 'center' is being ignored. I changed the output from 'text' to 'latex' or 'markdown' as described on the function but it still doesn't work. Consider the example below from here: https://cran.r-project.org/web/packages/table1/vignettes/table1-examples.html

library(boot) 

melanoma2 <- melanoma
 
# Factor the basic variables that
# we're interested in
melanoma2$status <- 
  factor(melanoma2$status, 
         levels=c(2,1,3),
         labels=c("Alive", # Reference
                  "Melanoma death", 
                  "Non-melanoma death"))
As a first attempt, we can do the following:

table1(~ factor(sex) + age + factor(ulcer) + thickness | status, output = 'markdown', align = 'center, data=melanoma2)

FelipeCarrillo avatar Aug 04 '23 20:08 FelipeCarrillo

Hello Benjaminrich,

I have a similar issue related to formatting alignment. I'm wondering if it's possible to have all descriptive statistics align either left or right, except for the first variable column. When I checked the original R codes, I found that the alignment is set to center, and there doesn't appear to be a parameter to control the alignment.

Thank you for your assistance.

SmartChen96 avatar Nov 07 '23 14:11 SmartChen96