Skip to content

megfitz/mixpanel-API-to-R

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 

Repository files navigation

Mixpanel.r

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.

Mixpanel_cleanup.r

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

About

Import Mixpanel data directly into R or RStudio with this script

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages