Skip to content

Instantly share code, notes, and snippets.

View jdeboer's full-sized avatar

Johann de Boer jdeboer

View GitHub Profile

Keybase proof

I hereby claim:

  • I am jdeboer on github.
  • I am johanndeboer (https://keybase.io/johanndeboer) on keybase.
  • I have a public key ASDIXpXJ1kDZi3PdYR4sXSM06sH5AgWa5mWRvAX1sK8-Zgo

To claim this, I am signing this object:

@jdeboer
jdeboer / ga-package-downloads.R
Created August 18, 2018 08:52
Generate a trend plot showing the cumulative downloads of Google Analytics R packages via RStudio's CRAN mirror. The data is accessed using the cranlogs package.
library(tidyverse)
packages <- c("ganalytics", "googleAnalyticsR", "RGoogleAnalyticsPremium", "RGA", "GAR")
df_raw <- cranlogs::cran_downloads(packages, from = "2013-04-09", to = Sys.Date() - 1L)
df <- tbl_df(df_raw) %>%
group_by(package) %>% mutate(count = cumsum(count)) %>% ungroup() %>%
filter(count > 0L) %>%
mutate(package = factor(package) %>% fct_reorder(count, max, .desc = TRUE))
@jdeboer
jdeboer / GAUC2013.R
Last active August 17, 2016 16:27
The R script used during my presentation at GAUC 2013 to join weather data from BoM with web data from Google Analytics.
# Please replace this sample profile ID with that of your own
# Google Analytics profile.
profile_id <- 123456789
# Please ensure you have all of the following libraries
# installed first.
library(ganalytics)
library(httr)
library(XML)
library(lubridate)