Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- require(plotly)
- require(dplyr)
- randomData <- sample.int(100000, 100, replace = TRUE)
- sortedRandomData <- sort(randomData)
- data.frame(a = sortedRandomData) %>%
- plotly::plot_ly(name = "firstPlot") %>%
- plotly::add_trace(y = ~a,type = 'scatter',mode = 'markers')
- ma <- function(x, n = 80){stats::filter(x, rep(1 / n, n), sides = 2)}
- movedAverageData <- ma(sortedRandomData)
- data.frame(b = movedAverageData) %>%
- plotly::plot_ly(name = "secondPlot") %>%
- plotly::add_trace(y = ~b,type = 'scatter',mode = 'markers')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement