Add Matrix With Clinical Data To Expression Matrix
1
0
Entering edit mode
11.2 years ago
moranr ▴ 290

Hi,

I have two objects:

1) An expression matrix -allData - contains 949 rows, the first column is the arrayID

2) A matrix with clinical data-clinicalChar also 949 rows, and the first column is the arrayID,

The first column(arrayIDs) of both match up to each other, so i just need to add it. I need to add the clinical data matrix ot the allData matrix, how can I do this ?

Thanks for the help, R

bioconductor microarray r matrix • 2.1k views
ADD COMMENT
2
Entering edit mode

You REALLY want to be using ExpressionSets for storing clinical data alongside genomic data such as expression data. See the vignette from the Biobase package for details.

ADD REPLY
1
Entering edit mode
11.2 years ago
zx8754 11k

If both allData and clinicalChar are sorted on arrayID, then just cbind:

allData_new <- cbind(allData,clinicalChar)

If not sorted, then merge:

allData_new <- merge(allData, clinicalChar, by="arrayID")
ADD COMMENT

Login before adding your answer.

Traffic: 1884 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6