I'm using the vistime R package to create a timeline in R Shiny. I'm looking to add a "Name" filter so the user would select a name from the dropdown, and then the timeline would only show be for the name selected. Below is example code. Rather than showing a timeline with all presidents, the user would select a president from the dropdown, and then timeline would only be for the president selected. Any ideas on how to incorporate this into the code? Thanks.
pres <- data.frame(Position = rep(c("President", "Vice"), each = 3),
Name = c("Washington", rep(c("Adams", "Jefferson"), 2), "Burr"),
start = c("1789-03-29", "1797-02-03", "1801-02-03"),
end = c("1797-02-03", "1801-02-03", "1809-02-03"),
color = c('#cbb69d', '#603913', '#c69c6e'),
fontcolor = c("black", "white", "black"))
vistime(pres,
col.event = "Position",
col.group = "Name",
title = "Presidents of the USA")