0

When making a preliminary table 1, I get the above error message, despite the fact that the length of all vectors involved (using length(x)) is the same : 11,142.

Example of code:

library(devtools)
install_github("emwozniak/Table1")
library(Table1)

make.table(dat          = bio_clean,
           strat        = "race_ethnicity",
           cat.varlist  = c("agecat", "bmicat", "smoker_current_new", "sex"),
           cat.header = c("Age Category", "BMI Category", "Smoking Status", "Sex"),
           cat.rownames = list(c("<25", "25-44", "45-64", ">=65"), c("<18.5", "18.5-24", "25-29", ">=30"), c("Never", "Current", "New"), c("Male","Female")),
           cont.varlist = c("sbpx_clean", "bmi", "age"),
           cont.header = c("Systolic Blood Pressure", "BMI", "Age"),
           caption = "Table 1. Selected Participant Characteristics by Race/Ethnicity",
           stripe.col = "#e1e9b7",
           header.style = "bold",
           footer = FALSE,
           output       = "html")

Again, I've manually checked the length of each vector, so I'm not sure what the issue could be. The only thing I can think of is that only a couple of the vectors have a "unit" attribute, but that shouldn't be a problem? Thanks!

  • Where does the `make.table` function come from? That's not a base R function. It's easier to help you if you provide a [reproducible example](https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example) with sample input and desired output that can be used to test and verify possible solutions. – MrFlick Aug 28 '22 at 19:18
  • 2
    @MrFlick, it appears to come from the [github package `Table1`](https://github.com/emwozniak/Table1/blob/master/NAMESPACE#L8) (which appears to be different from CRAN's `table1` package). It looks like the github version is from 6+ years ago, are you certain you need that specific version, @sheelanmirza? – r2evans Aug 28 '22 at 19:23

0 Answers0