I'm trying to do a pearson correlation in R using rcorr or cor.
My code looks as simple as this
correlation_results_tf <- rcorr(as.matrix(tf_numerical), as.matrix(p_numerical), type = 'pearson')
I get output error ->
Error in cbind(x, y) : number of rows of matrices must match (see arg 2)
The reason is because tf_numerical which is subbed from the original dataframe is 1K rows and the p_numerical is 500 rows. Is there anyway of me being able to see the correlation between all the gene samples of tf and all the gene samples at p?
I would appreciate the help!