I\'m new to markov chain modelling and I just tried the markovchain package in R to create a second-order transition matrix of my datavector sequence
markovchain
sequence