also in base R
R
levels(interaction(vars, vis, lex.order = TRUE)) [1] "PL.1" "PL.2" "PL.3" "SR.1" "SR.2" "SR.3"
lex.order is only necessary to sort the results; it can be omitted if order of elements is not important
lex.order