function to find the specific variables

have a base data set with 50 variables. Further in my code I use this line to get the specific variables available for that week, in this week there is only 4 variables with values:

> all_cols = c("Vaccine", "SEX", "AGE", "AIDS")
> 
> cols = c("Vaccine", "SEX", "AGE", "AIDS")
> 
> filtered_cols <- cols[cols %in% all_cols]
> ```

from that I make a table 1 with `univariateTable` How can I then get the filtered cols into this univariatetable? without manually deleting the coloumns that doesnt appear that week - is should only be this:

> ```
> table1 = summary(univariateTable(vaccine~Sex+AGE+Q(AGE)+AIDS
>                                   ,
>                                  data = DF),
>                  show.pvalues=F) 
> ```

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.