The goal of {ramb} is to return various “move”-objects to tibbles for further downstream processing using the tidyverse lingo. The focus has been on AIS vessel data and has only been tested on limited dataset.
You can install the development version of {ramb} from GitHub with:
# install.packages("devtools")
devtools::install_github("einarhjorleifsson/ramb")
Basic example of workflow:
ramb::creel %>%
ramb::rb_gaussian() %>%
dplyr::glimpse()
#> number of iterations= 18
#> number of iterations= 25
#> number of iterations= 49
#> number of iterations= 21
#> number of iterations= 73
#> Rows: 2,221
#> Columns: 14
#> $ id <int> 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, …
#> $ ID <chr> "Animal1", "Animal1", "Animal1", "Animal1", "Animal1",…
#> $ step <dbl> 237.1997, 231.0651, 225.8796, 225.0682, 218.7207, 220.…
#> $ angle <dbl> NA, -0.002635387, -0.106005617, -0.088730742, 0.056878…
#> $ x <dbl> 434561.8, 434361.9, 434167.5, 433991.5, 433829.3, 4336…
#> $ y <dbl> 6451521, 6451648, 6451773, 6451915, 6452071, 6452213, …
#> $ rowid <int> 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16,…
#> $ time <dttm> 2017-05-19 06:50:28, 2017-05-19 06:51:28, 2017-05-19 …
#> $ lon <dbl> -4.113320, -4.116755, -4.120097, -4.123131, -4.125934,…
#> $ lat <dbl> 58.20003, 58.20115, 58.20224, 58.20348, 58.20486, 58.2…
#> $ behaviour <chr> "steaming", "steaming", "steaming", "steaming", "steam…
#> $ speed <dbl> 7.684481, 7.485738, 7.317747, 7.291460, 7.085823, 7.13…
#> $ threshold.lower <dbl> 0.2430516, 0.2430516, 0.2430516, 0.2430516, 0.2430516,…
#> $ threshold.upper <dbl> 0.8481267, 0.8481267, 0.8481267, 0.8481267, 0.8481267,…
ramb::creel %>%
ramb::rb_gaussian_binary_clustering() %>%
dplyr::glimpse()
#> [1] 0 -0.0000e+00 4 583
#> [1] ... Stable clustering
#> [1] 0 -0.0000e+00 4 507
#> [1] ... Stable clustering
#> [1] 0 -0.0000e+00 4 239
#> [1] ... Stable clustering
#> [1] 0 -0.0000e+00 4 510
#> [1] ... Stable clustering
#> [1] 0 -0.0000e+00 4 387
#> [1] ... Stable clustering
#> Rows: 2,226
#> Columns: 12
#> $ id <int> 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, …
#> $ time <dttm> 2017-05-19 06:50:28, 2017-05-19 06:51:28, 2017-05-19 06:52:…
#> $ lon <dbl> -4.113320, -4.116755, -4.120097, -4.123131, -4.125934, -4.12…
#> $ lat <dbl> 58.20003, 58.20115, 58.20224, 58.20348, 58.20486, 58.20612, …
#> $ behaviour <chr> "steaming", "steaming", "steaming", "steaming", "steaming", …
#> $ rowid <int> 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 1…
#> $ spn <dbl> 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, …
#> $ dst <dbl> 236.8297, 230.7055, 225.5699, 224.7963, 218.4333, 220.0266, …
#> $ hdg <dbl> 5.265419, 5.268006, 5.374033, 5.462746, 5.405811, 5.373317, …
#> $ A <dbl> 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, …
#> $ turn <dbl> 0.000000000, 0.002587027, 0.106026693, 0.088713472, 0.056934…
#> $ speed <dbl> 7.672494, 7.474090, 7.307713, 7.282650, 7.076512, 7.128130, …
ramb::creel %>%
ramb::rb_hidden_markov_step() %>%
dplyr::glimpse()
#> number of iterations= 16
#> number of iterations= 19
#> number of iterations= 50
#> number of iterations= 20
#> number of iterations= 87
#> Rows: 2,221
#> Columns: 11
#> $ id <int> 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, …
#> $ ID <chr> "Animal1", "Animal1", "Animal1", "Animal1", "Animal1", "Anim…
#> $ step <dbl> 237.1997, 231.0651, 225.8796, 225.0682, 218.7207, 220.3293, …
#> $ angle <dbl> NA, -0.002635387, -0.106005617, -0.088730742, 0.056878715, 0…
#> $ x <dbl> 434561.8, 434361.9, 434167.5, 433991.5, 433829.3, 433663.4, …
#> $ y <dbl> 6451521, 6451648, 6451773, 6451915, 6452071, 6452213, 645235…
#> $ time <dttm> 2017-05-19 06:50:28, 2017-05-19 06:51:28, 2017-05-19 06:52:…
#> $ lon <dbl> -4.113320, -4.116755, -4.120097, -4.123131, -4.125934, -4.12…
#> $ lat <dbl> 58.20003, 58.20115, 58.20224, 58.20348, 58.20486, 58.20612, …
#> $ behaviour <chr> "steaming", "steaming", "steaming", "steaming", "steaming", …
#> $ vit <int> 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, …
ramb::creel %>%
ramb::rb_hidden_markov_step_and_turn() %>%
dplyr::glimpse()
#> number of iterations= 15
#> number of iterations= 19
#> number of iterations= 50
#> number of iterations= 20
#> number of iterations= 86
#> Rows: 2,221
#> Columns: 11
#> $ id <int> 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, …
#> $ ID <chr> "Animal1", "Animal1", "Animal1", "Animal1", "Animal1", "Anim…
#> $ step <dbl> 237.1997, 231.0651, 225.8796, 225.0682, 218.7207, 220.3293, …
#> $ angle <dbl> NA, -0.002635387, -0.106005617, -0.088730742, 0.056878715, 0…
#> $ x <dbl> 434561.8, 434361.9, 434167.5, 433991.5, 433829.3, 433663.4, …
#> $ y <dbl> 6451521, 6451648, 6451773, 6451915, 6452071, 6452213, 645235…
#> $ time <dttm> 2017-05-19 06:50:28, 2017-05-19 06:51:28, 2017-05-19 06:52:…
#> $ lon <dbl> -4.113320, -4.116755, -4.120097, -4.123131, -4.125934, -4.12…
#> $ lat <dbl> 58.20003, 58.20115, 58.20224, 58.20348, 58.20486, 58.20612, …
#> $ behaviour <chr> "steaming", "steaming", "steaming", "steaming", "steaming", …
#> $ vit <int> 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, …