I have two different lists (a and b) containing 626257 vectors, each vector containing 44 numeric entries. One list contains sample data and the other list serves as a reference. Now I want to calculate the pearson correlation between all the entries of both lists. I store the values in a variable (r).
The output of "r" does unfortunately only contain "NA" entries.
Here the code to generate two dummy lists.
a = replicate(626257,rep(10,44),simplify = FALSE)
b = replicate(626257,rep(3,44),simplify = FALSE)
And here the code to calculate the correlation.
r = lapply(seq_along(a), function(ind)cor(a[[ind]], b[[ind]]))
View(r)