Description Usage Arguments Value Author(s) References Examples
View source: R/mixpanelJQLQuery.R
This method performs a JQL Query with some custom script as parameter. The query string can be given either as character vector or saved into a file and passed via file name.
1 | mixpanelJQLQuery(account, jqlString, jqlScripts, paths=".", columnNames, toNumeric=c())
|
account |
A mixpanel account, as defined in |
jqlString |
JQL script as string. |
jqlScripts |
List of JQL script file names. |
paths |
Paths to search JS files. |
columnNames |
Column names for the resulting data.frame. Optional. |
toNumeric |
Column indices which should be converted to numeric. Optional. |
If data==TRUE
, the method returns the response of the API request (raw character vector). Otherwise nothing is returned.
Meinhard Ploner
https://mixpanel.com/help/reference/jql
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | ## 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)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.