На основе комментария @ user2554330, вот решение crosstalk
.
---
title: "crossover test"
output: html_document
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = FALSE)
library( crosstalk )
library( leaflet )
library( dplyr )
```
```{r load data }
data <- data.frame(id = c(1,2,3,4,5),
lat= c(50.9, 50.8, 50.5, 50.5, 51),
lon = c(-0.7, -0.92, -1, -0.8, -0.9),
date = c("2020-06-01", "2020-05-07", "2020-03-24", "2020-04-01", "2020-05-26"))
data <- data %>% dplyr::mutate( date2 = as.numeric( as.Date( date ) ),
date3 = as.Date( date )
)
```
```{r maak shared data object}
shared_data <- SharedData$new( data )
```
```{r genereer output}
filter_slider("date", "Date", shared_data, ~date3, width = "100%")
leaflet(shared_data, width = "100%", height = 800) %>%
leaflet::addTiles() %>%
leaflet::addMarkers()
```
введите описание изображения здесь