# NOT RUN {
## Fill in here the API token, key and secret as found on
## www.mixpanel.com - Account -> Projects.
account = mixpanelCreateAccount("ProjectName",
token="c12g3...",
secret="168e7e...",
key="543c55...")
## Simple query: number of events for each 'distinct_id'.
jqlQuery <- '
function main() {
return Events({
from_date: "2016-01-01",
to_date: "2016-12-31"
})
.groupByUser(mixpanel.reducer.count())
}'
res <- mixpanelJQLQuery(account, jqlQuery,
columnNames=c("distinctID", "Count"), toNumeric=2)
hist(res$Count)
# }
Run the code above in your browser using DataLab