I have checked the documentation of the package and found an example of how they fitted a DTMC on data.frame objects using the following code:
library(holson)
data(holson)
singleMc<-markovchainFit(data=holson[,2:12],name="holson")
The data I apply the code to is structured essentially in the same way as the holson data only that there are 10 states. Additionally, the numbers in my excel file are indeed integers and not class characters. These states are the numbers 1 to 10. When I run the code on my data it gives me a transition matrix where the states are listed as followed in (1,10,2,3,4,5,6,7,8,9). Thus in the matrix the state following 1 is 10.
It appears to me that R Studio thinks that the character 10 is between 1 and 2? (Like lexicographic sorting?) How can I fix this issue and have the package recognize 10 as the character following 9?
EDIT: Here is an example
library(markovchain)
set.seed(12)
Test <- data.frame(entity = LETTERS[1:100],
Time1 = round(runif(n = 100, min = 1, max = 10)),
Time2 = round(runif(n = 100, min = 1, max = 10)),
Time3 = round(runif(n = 100, min = 1, max = 10)))
Test_Fit <- markovchainFit(data=Test[,2:4] , name="Test_FIT")
Est_Test_Fit <- Test_Fit$estimate
Est_Test_Fit@transitionMatrix