Hello - I'm a new R user and was trying to use final fit package to simplify some of my tables etc. https://www.r-bloggers.com/2018/05/elegant-regression-results-tables-and-plots-in-r-the-finalfit-package/
I keep running into an error with the code where it can't find the variable diabetes. Although when I list it, it is there in the dataset. I've pasted the code and error message below. Diabetes is a "yes/no" variable - could that be part of the issue?
Many thanks.
library(finalfit)
library(dplyr)
data(diabetesdata)
diabetes <- as.factor(diabetesdata[,"dm"])
explanatory = c("hdl", "age")
dependent = "diabetes" # diabetes as outcome
diabetesdata %>%
summary_factorlist(dependent, explanatory, p=TRUE, add_dependent_label=TRUE)
list(diabetes). # I did this to check the variable and it's fine
Error: Can't subset columns that don't exist.
x Column diabetes
doesn't exist.