@Roland and @Limey, thank you so much for your suggestions and advice! I deleted the last line with assign()
, then wrote logit.admit.3grp <- myf(...)
for each outcome, and it's working as I intended. @Roland, I see your point about not using lapply/sapply. I just wanted to make the one I have work first to understand R better. I have written some codes using lapply/sapply that work fine (with help from other R users), and now I need to work more on adding tbl_regression
to it and use tbl_merge
to bind all together. Will see. Thank you everyone!