I have a data frame of 200*1000 rows and 6 columns. I want to calculate the correlation between 2 columns cor(df$y1, df$y2)) for every 200 rows, so that I get 1000 different correlation values as a result.
When I wanted to calculate the sums of every 200 rows I could simply use
rowsum(df,rep(1:1000,each=200))
but there is no such command in r as rowcor that I could use equivalently for correlations.