Created
November 6, 2014 21:25
-
-
Save randyzwitch/84ed248f49785f498fea to your computer and use it in GitHub Desktop.
Daily Pageviews RSiteCatalyst
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Installing BreakoutDetection package | |
install.packages("devtools") | |
devtools::install_github("twitter/BreakoutDetection") | |
library(BreakoutDetection) | |
library("RSiteCatalyst") | |
SCAuth("company", "secret") | |
#Get pageviews for each day in 2014 | |
pageviews_2014 <- QueueOvertime('report-suite', | |
date.from = '2014-02-24', | |
date.to = '2014-11-05', | |
metric = 'pageviews', | |
date.granularity = 'day') | |
#v1.0.1 of package requires specific column names and dataframe format | |
formatted_df <- pageviews_2014[,c("datetime","pageviews")] | |
names(formatted_df) <- c("timestamp", "count") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment