Hi all,
I should like to ask your help about a calculate line of my script.
I would like to calculate, for each line of a dataframe called "test_AE33", a correlation coefficient (r²) between :
- c( dataframe$column1, dataframe$column2,..., dataframe$column7)
- c (370, 470, 525, 590, 660, 880, 940) (constant values)
I try to apply that thanks to this line :
test_AE33$r_carre = round(cor( c(test_AE33$babs1, test_AE33$babs2, test_AE33$babs3, test_AE33$basb4, test_AE33$basb5, test_AE33$basb6, test_AE33$basb7), c(370, 470, 525, 590, 660, 880, 940), use = "complete.obs"), 2)
But RStudio answer is : "Error in cor(c(test_AE33$babs1, test_AE33$babs2, test_AE33$babs3, test_AE33$basb4, :
dimensions incompatibles"
Though, we have the same number of canstants than columns...
Some ideas?
Thanks for your help !