# NOT RUN {
# }
# NOT RUN {
# use `aggregateGAData` so you can on the fly create summary data
ga_data <- google_analytics(81416156,
date_range = c("10daysAgo", "yesterday"),
metrics = "sessions", dimensions = c("hour","date"))
# if we want totals per hour over the dates:
aggregateGAData(ga_data[,c("hour","sessions")], agg_names = "hour")
# it knows not to sum metrics that are rates:
aggregateGAData(ga_data[,c("hour","bounceRate")], agg_names = "hour")
# }
Run the code above in your browser using DataLab