Web Application Development with R Using Shiny - Second Edition by Chris Beeley

Web Application Development with R Using Shiny - Second Edition by Chris Beeley

Author:Chris Beeley [Beeley, Chris]
Language: eng
Format: azw3
Publisher: Packt Publishing
Published: 2016-01-29T05:00:00+00:00


Having set this up, the animated graph code is pretty simple, looking very much like the monthly graph data except with the linear smooth based on a subset of the data instead of the whole dataset. The graph is set up as before and then a subset of the data is produced on which the linear smooth can be based:

groupByDate <- group_by(passData(), YearMonth, networkDomain) %>% summarise(meanSession = mean(sessionDuration, na.rm = TRUE), users = sum(users), newUsers = sum(newUsers), sessions = sum(sessions)) groupByDate$Date <- as.Date(paste0(groupByDate$YearMonth, "01"), format = "%Y%m%d") smoothData <- groupByDate[groupByDate$Date %in% quantile(groupByDate$Date, input$animation / 100, type = 1) : quantile(groupByDate$Date, (input$animation + 20) / 100, type = 1),]



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.