rforcecom: an r package which provides a connection to force.com and salesforce.com
Embed Size (px)
DESCRIPTION
TRANSCRIPT
- RForcecom: An R package which provides a connection to Force.com and Salesforce.com Takekatsu Hiramura 2014-07-02 The R User Conference 2014 @ UCLA 1
- Agenda 2 1. About me 2. Brief introduction of Force.com and Salesforce.com 3. Overview of RForcecom 4. Features of RForcecom 5. Example of the analysis using RForcecom -Visualizing consumers voice-
- Agenda 3 1. About me 2. Brief introduction of Force.com and Salesforce.com 3. Overview of RForcecom 4. Features of RForcecom 5. Example of the analysis using RForcecom -Visualizing consumers voice-
- Takekatsu Hiramura IT consultant, Software Engineer and Data scientist Private website: http://thira.plavox.info/ Blog: http://hiratake55.wordpress.com/ R-bloggers: http://www.r-bloggers.com/author/takekatsu-hiramura/ 4
- Agenda 5 1. About me 2. Brief introduction of Force.com and Salesforce.com 3. Overview of RForcecom 4. Features of RForcecom 5. Example of the analysis using RForcecom -Visualizing consumers voice-
- Specific features of CRM About Salesforce.com/Force.com 6 Salesforce.com is one of the most famous SaaS (Software-as-a-Service) based CRM (Customer Relationship Management) service. Force.com is a application platform of Salesforce.com, and it specifically called PaaS (Platform-as-a-Service). Campaign Management Contract Management Customer Management Product Management and etc. Sales Forecasting Case Management Overview of the Application/Service Architecture Application Platform Service Custom Object Apex / VisualForce Web API and etc.
- Agenda 7 1. About me 2. Brief introduction of Force.com and Salesforce.com 3. Overview of RForcecom 4. Features of RForcecom 5. Example of the analysis using RForcecom -Visualizing consumers voice-
- The RForcecom package I developed an R package RForcecom which provides a connection to Salesforce.com and Force.com via REST API. 8 Statistical Analysis Machine Learning Data Manipulation Visualization Customer Relationship Management Dashboard Collaboration Platform (Chatter,Schedule,ToDo etc.) RSalesforce.com Delete Insert Update/Upsert Data extract SOQL query Search
- The CRAN page of the RForcecom 9 http://cran.r-project.org/web/packages/RForcecom/
- Source code is available on GitHub 10 https://github.com/hiratake55/RForcecom
- Agenda 11 1. About me 2. Brief introduction of Force.com and Salesforce.com 3. Overview of RForcecom 4. Features of RForcecom 5. Example of the analysis using RForcecom -Visualizing consumers voice-
- Features of RForcecom Execute a SOSL rforcecom.search() Create a record rforcecom.create() Retrieve record rforcecom.retrieve() Update a record rforcecom.update() Upsert a record rforcecom.upsert() Delete a record rforcecom.delete() Retrieve a server timestamp rforcecom.getServerTimestamp() Execute a SOQL rforcecom.query() Sign in to the Force.com rforcecom.login() Feature Function name# Retrieve object descriptions rforcecom.getObjectDescription() Retrieve a list of objects rforcecom.getObjectList 8 2 3 4 5 6 11 7 1 10 9 12
- Sign in to the Force.com 13 > library(RForcecom) > username password session objectName fields rforcecom.retrieve(session, objectName, fields, order=c("CaseNumber"),limit=12) Salesforce.com R
- Execute a SOQL > soqlQuery rforcecom.query(session, soqlQuery) 15 Salesforce.com R
- Agenda 16 1. About me 2. Brief introduction of Force.com and Salesforce.com 3. Overview of RForcecom 4. Features of RForcecom 5. Example of the analysis using RForcecom -Visualizing consumers voice-
- RForcecom demo : Visualizing consumers voice Assume you are a manager at a company and want to know the consumers voice from CRM. Consumers voices are stored in Salesforce.com which registered by their call center staff. 17 Call Center Salesforce.com R Managers Data collection/ Operation Data Management Data Analysis Reporting Customer Mgmt. Case Mgmt. REST/SOAP API API Client (RForcecom) NLP (TreeTagger) Visualization (Wordcloud)
- Sample Dataset: Deltas Twitter Social Customer Support Account It is difficult to use actual dataset, so I crawled Delta Airlines Twitter account (@DeltaAssist)and stored tweets to Salesforce.com instead of actual dataset. 18 https://twitter.com/DeltaAssist/with_replies
- Step 1: Retrieving a dataset from Salesforce.com Tweets sent to @DeltaAssist are stored in Salesforce.com. 19
- Step 1: Retrieving a dataset from Salesforce.com Tweets sent to @DeltaAssist are stored in Salesforce.com. 20
- Step 1: Retrieving a dataset from Salesforce.com Load required libraries and sign into Salesforce.com. 21 > library(RForcecom) > username password session CustomerVoice head(CustomerVoice$Tweet__c,10)
- Step 2: Extracting high-frequency keywords 23 > library(koRpus) > temp.file.name write.table(CustomerVoice$Tweet__c,temp.file.name,col.names=F,row.names=F) > tagged tagged.DF head(tagged.DF,10) Tag the word class for each words using koRpus package and TreeTagger.
- Step 2: Extracting high-frequency keywords 24 > term term head(term,20) Filter noun from tagged list
- Step 2: Extracting high-frequency keywords 25 > term.unique term.freq termfreq termfreq head(termfreq,10) Count frequencies of the terms.
- Step 3: Visualizing the words as a word cloud 26 > library(wordcloud) > termfreq.top pal windowsFonts(SegoeUI = "Segoe UI") > wordcloud(termfreq.top$term, termfreq.top$freq, random.color=T, colors=pal, family="SegoeUI") Visualize the terms using wordcloud package. Flight is the most frequent.
- Step 4: Visualize the Buzz-word of the day 27 > CustomerVoice.sun CustomerVoice.mon CustomerVoice.tue CustomerVoice.wed CustomerVoice.thu CustomerVoice.fri CustomerVoice.sat CustomerVoice.all