Proper use of use of "cor" function in R
- by order
I am interested to know what a proper x (vector matrix or data frame) input looks like. I am currently using the function in two different sorts of matrices. However, I am not sure how R would interpret my data the way I intend. I will explain the types of matrix by example.
Type 1
Gene1 Gene2 Gene3
sample1
sample2
Type 2
Sample1 Sample2 Sample3
gene 1
gene 2
gene 3
Are either of these formats valid x parameters? I input both of types of matrices and get some results, but without knowing whether or not this a proper use the function, these are just random numbers. Thank you for your time. I apologize that this isn't more interesting.