library(bsam)
## Loading required package: rjags
## Loading required package: coda
## Linked to JAGS 4.2.0
## Loaded modules: basemod,bugs
##
## Attaching package: 'bsam'
## The following object is masked from 'package:stats':
##
## simulate
data(ellie)
library(trip)
## Loading required package: sp
tr <- ellie
coordinates(tr) <- c("lon", "lat")
proj4string(tr) <- CRS("+init=epsg:4326")
tr <- trip(tr, c("date", "id"))
colshorten <- function(x) lapply(strsplit(x, ""), function(a) paste(a[c(1, 2, 4, 6)], collapse = ""))
trcol <- colshorten(viridis::viridis(length(unique(tr$id))))
library(dplyr)
##
## Attaching package: 'dplyr'
## The following objects are masked from 'package:stats':
##
## filter, lag
## The following objects are masked from 'package:base':
##
## intersect, setdiff, setequal, union
library(leaflet.extras)
## Loading required package: leaflet
pts <- structure(list(x = c(71, 114.3, 96.4, 70.3, 51.4, 31.7, 38.2,
66.7), y = c(-49.1, -64.9, -63.6, -50.1, -65.8, -68.2, -64.8,
-48.2)), .Names = c("x", "y"))
leaflet() %>% addProviderTiles("Esri.NatGeoWorldMap") %>%
addPolylines(data = as(tr, "SpatialLinesDataFrame"), color = trcol) %>%
addGeodesicPolylines(lng = pts$x, lat = pts$y,weight = 2) %>%
addCircles(pts$x, pts$y)