Skip to content

Instantly share code, notes, and snippets.

@randyzwitch
Created November 6, 2014 21:25
Show Gist options
  • Save randyzwitch/84ed248f49785f498fea to your computer and use it in GitHub Desktop.
Save randyzwitch/84ed248f49785f498fea to your computer and use it in GitHub Desktop.
Daily Pageviews RSiteCatalyst
#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