rMSWITCH is an R package for estimation and statistical testing for the number regimes of various Markov regime-switching models, including both regime-switching in intercept (MSI) and in mean (MSM) models. The package is currently under development.
Open R console and run the following script.
# install.packages("devtools") # if devtools has not been installed, run this line.
devtools::install_github("chiyahn/rMSWITCH")