What is R?
R is a tool designed to perform statistical and graphical analysis which is used by those professionals who work on market research, data analysis or statistics among others. Since R contains a vast variety of packages, it enables us with many possibilities when processing, modeling, analyzing and exploring data. To mention a few examples, R could help us create and visualize lineal and non lineal regression models, data mapping, analyze correlations, etc.
In order to take advantage of all the possibilities that R can provide us with, it is first advisable to learn its language. Once we learn about the different commands and feel comfortable with the interface, we will be able to define our own functions in order to get the most of our data.
R is software available for many operating systems, among them, Windows, Linux, and Mac. In this article we are going to be installing R with Windows, but we will share links and information to those that use other kind of operating system.
* Why R and not another software?
First of all, R software is free. Users are free to use, modify and share R. Moreover, the biggest benefit one can take from it is its community. R holds a large and active community around the globe who are always sharing new ways of using R so we can all use adn adapt them for our own purposes.
As well, R enables us to create, model and safe scripts so we can use them whenever we want. Being able to do so, we are going to become more efficient and precise with our research. Furthermore, R not only allows us to show our results with tables but also let us visualize our data in a very compeling way with graphs such as histograms or maps.
As previously said, R holds a very large community of users who share their thoughts and ideas within the many websites or blogs they participate in. If you ever get stuck on some function or would like to learn about a specific topic of R, you could always visit:
Lastly, you should consider using R if what you really want is a versatile tool which lets you manipulate your data with ease and show them in different kinds of ways. With R you will be able to process and analyze big data in a very extensive way, designing your own functions so you can have a more specific outcome. From quantitative questionnaires to heat maps or qualitative data from our Facebook or Twitter accounts. To finalize, it is important to highlight that R is supported by many organizations such as Google, Twitter, Facebook or Gapminder.
What can we use R for?
From a marketing point of view, R could be used to perform online and offline market research. Following, a brief example idea of how we could use R for. Moreover, at the end of this paper, you will get access to some practical examples of R.
Qualitative questionnaires from your consumers; With R you will be able to test attribution or conceptual models with one or many variables. This can be analyzed with the “survey” package. In this package, you will get access to means, regression models, Taylor variance, different radio types, loglinear models, etc. With all these, you will be able to test your hypothesis so you can validate or redesign your model.
Tex Mining of your Twitter or Facebook accounts. By downloading the data from the API of the different platforms, you will obtain real-time data. With this method, you will be able to compare your tweets and investigate which has made a bigger impact, obtain descriptive information about your users, age, location, sex or you could even do research on the amount of positive and negative tweets you got when publishing an specific tweet.
We could as well use Facebook to get a greater view of our current followers on Facebook and whether they match with our idea of potential consumers. The amount of information given by platforms such as Facebook, Google Analytics, Twitter, can help us to understand our consumers in a more extended way as well as create strategies that adapt to those users. The most interesting thing about all those research is that all of them can be done within a single software, R, which will make us safe time as well as money.
Getting started with R
Firstly, you need to access to: http://cran.rstudio.com/ and download the last version of R for your Window (If you have another operating system, you can as well download your version from the same link). After opening it, you need to accept the license and the installation will start immediately. Once the installation of R is done, you will need to install R Studio (This is the R interface which allow us to work with R more efficiently). http://www.rstudio.com/products/rstudio/download/ If you need help when installing, visit the following pages:
https://vimeo.com/97166163 (For R Studio)
Regarding the packages, it is highly recommended to install Swirl. This is an interactive course that will help you understand how you can work with R. In order to download the package you need to write the following function in the console of R or R Studio:
Afterwards, you will need to load Swirl into your directory with the following code:
What to do next
Previously, we recommended you to install swirl. It is advisable that you take the course if you have little or no knowledge about programming.
You can also take a look at the following online courses about R. There you will find exercises of the most common functions as well as advance lectures of how to use R. Another crutial thing you will learn within those courses is how to interact with the R community and where to get access to extended teaching material:
https://github.com/swirldev/swirl_courses#swirl-courses (R programming online course by the R Community)
https://www.coursera.org/course/datascitoolbox (Data analysis with R programming, online course by Facebook)
https://www.udacity.com/course/data-analysis-with-r–ud651 (Real examples of how to analyze data with R programming by Facebook)
http://tryr.codeschool.com/ (Exercises of R Programming)
https://www.youtube.com/playlist?list=PLOU2XLYxmsIK9qQfztXeybpHvru-TrqAP (Introduction of R Programming by Google Developers)
Case studies with R
Following, you have a series of case studies aiming to give you a broader view of how to apply R to your Online Marketing Strategies. The first example uses Google Analytics data in order to understand which kind of marketing campaigns is the one giving a higher ROI whithin a long-time-period.
The second example uses the Twitter API in order to get insights about the kinds of keywords associated to a Twitter account.
The last example uses the Facebook API in order to get insights of our friends behaviour on Facebook. This exercise enables us to analyse behaviours before and after they change their relationship status.