Principal Components Analysis in R

Principal Components are really useful for dataset with a large number of variables that potentially are correlated between them. By creating vectors using the variables, we reduce the number of ‘variables’ to be included in the model. The aim is to include the components that explain the larger volume of variation of the dataset.

How to do Principal Components Analysis using R?

Initially, we need data so let’s go to create:

x1<- c(122, 21, 105, 101, 155, 131, 115, 53, 75, 45)
x2<-c(117, 32, 140, 105, 149, 146, 82, 60, 82, 37)

The we will scale it with:

Read more

Sentiment Analysis, Twitter and R

Within the Data Science and Analytic Higher Diploma, I have been asked:

“Research an area of sentiment analysis that is of interest to you. Describe the process that is required to implement the analysis and how you would do this.”

So I through myself to research using ‘Google’ some information about Sentiment Analysis and I found this Youtube video that explains how to use R and Twitter to do some Sentiment Analysis.

Personally I think Michael Herman┬ádid a fair job with this video; however, it was published on 2012 – therefore with different changes going on in Youtube and new R versions, the code provided show various errors.

So, after playing around with the code provided in the video and doing some searches I successfully analysed some data.

Here is my R code for the Sentiment Analysis proposed by Michael: Read more