This is the next step in my attempt to build a user-friendly transition matrix in R, a follow-on to post
Please note that in the fuller code this MWE derives from, the table expands/contracts dynamically depending on the number of unique states detected in the underlying data.