removeItem | R Documentation |
Remove an item from a timeline
removeItem(id, itemId)
id |
Timeline id or a |
itemId |
The id of the item to remove |
## Not run: timevis(data.frame(id = 1:2, start = Sys.Date(), content = c("1", "2"))) %>% removeItem(2) ## End(Not run) if (interactive()) { library(shiny) shinyApp( ui = fluidPage( timevisOutput("timeline"), actionButton("btn", "Remove item 2") ), server = function(input, output) { output$timeline <- renderTimevis( timevis(data.frame( id = 1:2, start = Sys.Date(), content = c("1", "2")) ) ) observeEvent(input$btn, { removeItem("timeline", 2) }) } ) }
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.