Search code examples
rrcurlmixpanel

How to get data from Mixpanel using RMixpanel?


I am running the following script to extract data from MixPanel:

library(RMixpanel)
account<- mixpanelCreateAccount("abc", token = "123", secret = "456", key = "789")
mixpanelGetFunnelList(account)

From all the examples I have seen, these commands should work but after entering the last command, I am getting the following error:

Error in file(file, "r") : cannot open the connection

In addition: Warning messages:

1: running command 'curl -s -S "https://[email protected]/api/2.0/funnels/list/?" -o "temp_xyz.txt"' had status 127

2: In download.file(url, filePath, "curl", quiet = TRUE) : download had nonzero exit status

3: In file(file, "r") : cannot open file 'temp_xyz.txt': No such file or directory

I searched this error and the only possible explanation was that I don't have curl installed on my system but this shouldn't be an issue since while installing RMixpanel, RCurl was also installed. Still I have installed curl on my system and the same error is existing.

Also, when I copy pasted the url in error 1 in my browser, it was working and giving correct results.

Can someone guide me what is going wrong here?


Solution

  • I am the maintainer of the package RMixpanel. The package until version 0.5-2 used

    download.file(url, filePath, "curl", quiet=TRUE)
    

    which did not work on some systems (Windows?). Now I replaced it by using

    getURL()
    

    from package RCurl which should work correct. It will be available as of tomorrow on CRAN (version 0.6-0), or already now using the github source