Some R code to achieve:
- Read Data
- Summary variables
- Histogram graphic
- Boxplot
- Covariance Matrix
- Principal component analysis
Read & load data
oDatos ← read.table(“/home/edgar/…”, header=TRUE)
attach(oDatos)
Quantitative variables
summary(oDatos$eachVariable)
Categorical variables
summary(factor(oDatos$quality))
Histogram graphic
hist(eachVariable, col=”lightblue”, main=”Title’s Graphic”, ylab=”Y Label” , xlab=”X Label”, xlim=c(n,n), ylim=c(n,n))
Boxplot
boxplot(eachVariable, col=”lightblue”, ylab=”Y Label”)
save graphic
savePlot(“/home/edgar/…” type=”png”)
Covariance matrix
cor(oWine[,1:11])
Principal component analysis
oACP ← princomp(oWine[,1:11], cor=true)
summary(oACP)
plot(oACP, type=”l”, col=”lightblue”)
title(main=”Title’s Graphic”, xlab=”X Label”, ylab=”Y Label”)