Notifications
The ability to create notifications is part of a larger amount of functionality within shinydashboard, which allows you to create messages, tasks, and notifications in the header of your dashboard. For more details, visit rstudio.github.io/shinydashboard/structure.html.
In this example, we will just add notifications. The code is very similar to the other two types of content. On the server.R
side, the code is as follows:
output$notifications <- renderMenu({
This line allows the notification content to be rendered dynamically and called in the ui.R
file with dropdownMenuOutput("notifications")
. We have the following code:
users <- sum(gadf[gadf$date == max(gadf$date), "users"]) newusers <- sum(gadf[gadf$date == max(gadf$date), "newUsers"]) / sum(gadf[gadf$date == max(gadf$date), "users"]) * 100
These lines calculate the two values that we want— the number of users in the time period and the percentage of new users. We have the following code:
newusers <- round...