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!