I think what you have done should be fine. read.table() will return a
data frame, which cor() can handle happily. For example:
my.data <- read.table("file.csv", header = TRUE, row.names = 1,
sep=",", strip.white = TRUE) # assign your data to "my.data"
cor(my.data) # calculate the correlation ma
>
> If you read each of your 230,000 variables in separately, you can
> combine them into a matrix or dataframe using cbind(variablename1, 2,
> etc.).
>
> HTH,
I used read.table("file.csv", header = TRUE, row.names = 1, sep=",",
strip.white = TRUE)
to read it in but I could easily only read in th
Hello Vincent,
The command to correlate two variables and a set is the same (see
?cor). How have you read the data in? If it is a matrix or data
frame, you should be able to just use cor(name_of_your_matrix) and it
will return the correlation matrix for all variables in your matrix or
data frame
So I am very new to R. Have been using python for a project and need to
calculate the correlation coefficient matrix for my data set. the data is in
the range of 10-15 observations of 230,000 variables. ie the correlation
matrix would be 230,000X230,000 Using python and the numpy.corrcoef() I run
4 matches
Mail list logo