Solution: For-Loop
for (i in 1:length(video$user_id)) {!
if(video$event[i]==„play“) {!
for (j in (video$video_second[i]+1):max) {!
vector[j]=vector[j]+1!
}!
}!
else if(video$event[i]==„pause“ | video$event[i]==„stop“)
{!
for (j in (video$video_second[i]+1):max) {!
vector[j]=vector[j]-1!
}!
}!
}
Prototyping with R Shiny
ui.R server.R
SelectInput() input$...
uiOutput()
output$... <- renderUI()
SelectInput(): A select list control component.
uiOutput(„name“): Displays interface components created with renderUI().
renderUI(): Makes a reactive version of a function that generates HTML using the
Shiny UI and library (uiOutput)
output$name: Define output elements.
input$name: Use input elements.
reactive({}): A reactive expression updates this value whenever a contained widget changes.