I have a csv file containings a matrix:
version getSize() length() ... power
0 23000 23421 0.8
0 .. .. ..
1 .. .. ..
1 .. .. ..
I want to aggregate by similar versions applying the mean function to the columns. The columns are too many to write them. I also want to calculate the correlation matrix and binding the power column at the sides of the plot. My code is this:
matrix <- read.csv("/home/francesco/University/UoA/matrix.csv", header=TRUE, sep=",", fileEncoding="windows-1252")
power <- matrix[,"power"]
binded <- cbind(matrix,power)
aggregated <- aggregate(. ~ version, data = binded, mean)
corMatrix <- cor(aggregated, method="spearman")
library(lattice)
levelplot(corMatrix)
The plot is pretty confused and I get this warning:
Warning message:
In cor(aggregated, method = "spearman") : standard deviation is zero
A short extract of matrix.csv is:
version,native_drawBitmap,nPrepareDirty,nDrawDisplayList,startGC,power
00083,8,88,308,12,0.8967960131052847
00083,0,176,404,1,0.867644513259528
00084,8,88,307,10,0.8980234065469381
00084,0,181,408,1,0.871799879659241
Someone knows what I'm doing wrong?
Thanks in advance