Import Mixpanel data directly into R or RStudio with the mixpanel.r script
You need to have an API Key and API Secret from Mixpanel. This function takes the following arguments:
key = your API key (from your Mixpanel account details)
secret = your API secret (from your Mixpanel account details)
event = the event you want to export data for
unit = accepts hour/day/week/month
interval = numeric; the number of units you want
type = accepts unique/general/average
The function exports a data set to your global R environment with a list for the data legend, series and values.
This script will clean up the imported API data and takes the following arguments:
datasetname = defaults to "dataset", the list created in the Mixpanel.r script
event = needs to be the same event that you called for in the API call
This function will clean up the data, format the dates properly and return at data frame that has a column for the dates the events were observed and a column for the event occurances.
You can run this and the Mixpanel.r script multiple times to create data frames for multiple events and merge them together.
With feedback and questions, please contact
Meaghan Fitzgerald
meaghan@thetopfloorflat.com
@megfitz