If a tabulation function is called from the top level, it should print out
its table(s) on its own. If that tabulation function is called not from the
top level, such as from within a loop or another function, you need to call
print()
explicitly. For example:
set_survey(namcs2019sv)
for (vr in c("AGER", "SEX")) {
print( tab_subset(vr, "MAJOR", "Preventive care") )
}