I have a matrix which contains 984 rows and 2 columns (M and B), I want to do a spearman correlation of the 2 columns for every 12 rows, so in total 82 correlation. This is what I have
df ->read(......)
M = df$M
B = df$B
cnt <- 0
for (i in seq(1, nrow(df), by = 12)) {
M = df$[M,cnt]
B = df$[B, cnt]
resultM-B = cor(M, B, method = "spearman")
cat("Spearman correlation MB", resultM-B,"\n")
cnt <- cnt + 12
}
Thanks