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.
When
Xis a matrix,cor(X)will produce a square correlation matrix with the number of rows and columns equal to the number of columns in the original matrix. In other words,corproduces correlations between the columns in the matrix. Here is a simple example:Does that answer your question?