I have partially managed to prep my data using prepData function, to fit a HMM model to some coordinate data I have. However, when I run the summary of the prepData it has only found 1 animal and no covariates, but there should be 3 animals and one covariate named season.
This is my data set:
str(Movement)
tibble [2,257 × 4] (S3: tbl_df/tbl/data.frame)
$ ID : chr [1:2257] "SM1" "SM1" "SM1" "SM1" ...
$ Longditude: num [1:2257] 29.4 29.4 29.4 29.4 29.4 ...
$ Latitude : num [1:2257] -29.7 -29.7 -29.7 -29.7 -29.7 ...
$ season : num [1:2257] 1 1 1 1 1 1 1 1 1 1 ...
dput(head(Movement))
structure(list(ID = c("SM1", "SM1", "SM1", "SM1", "SM1", "SM1"
), Longditude = c(29.3656, 29.369317, 29.3691, 29.36905, 29.369133,
29.367517), Latitude = c(-29.725933, -29.72395, -29.726067, -29.725867,
-29.726383, -29.725083), season = c(1, 1, 1, 1, 1, 1)), row.names = c(NA,
-6L), class = c("tbl_df", "tbl", "data.frame"))
This is the code I am trying to use to prep my data for the model and I have put the results of what happens. The code does all run without errors but does not present the right information (not the right number of animals and no covariates)
trackData <- data.frame(coord1=Movement$Longditude,coord2=Movement$Latitude)
data <- prepData(trackData,type='LL',coordNames=c("coord1","coord2"))
> summary(data)
Movement data for 1 animal:
Animal1 -- 2257 observations
No covariates.
> head(data)
ID step angle x y
1 Animal1 0.42148108 NA 29.36560 -29.72593
2 Animal1 0.23560316 -2.208642 29.36932 -29.72395
3 Animal1 0.02269130 -2.837525 29.36910 -29.72607
4 Animal1 0.05775868 3.066238 29.36905 -29.72587
5 Animal1 0.21262713 -2.454933 29.36913 -29.72638
6 Animal1 0.00519162 -2.768395 29.36752 -29.72508
I am not sure why it cannot identify the other animals in my dataset or the covariate season. Please could someone help me work out why?
Thank you, in advance!!