Question: drop levels in eSet pData
1
gravatar for Shamim Sarhadi
3.7 years ago by
Shamim Sarhadi20 wrote:

I have an Eset that containing factors in its pData. When I create a subset of this eSet a new eSet is created. However, the factor variable retains all of its original levels , even when they do not exist in the new eSet , how I could drop this levels?

table(pData(eset)[ ,"Disease"])

these are the levels   : control      node negative breast cancer       node positive breast cancer

 

but after subseting my eSet dosn't have sample's related to node negative but their level are exist in the data

subsetting eset • 710 views
ADD COMMENTlink modified 3.7 years ago • written 3.7 years ago by Shamim Sarhadi20
Answer: drop levels in eSet pData
3
gravatar for Martin Morgan
3.7 years ago by
Martin Morgan ♦♦ 24k
United States
Martin Morgan ♦♦ 24k wrote:

This is the way that subsetting factors works in R, so is expected. One approach to updating is simply to call factor on the column eset$Disease <- factor(eset$Disease).  droplevels has similar functionality, and a data.frame method so pData(eset) = droplevels(pData(eset)).

ADD COMMENTlink modified 3.7 years ago • written 3.7 years ago by Martin Morgan ♦♦ 24k
Answer: drop levels in eSet pData
0
gravatar for Shamim Sarhadi
3.7 years ago by
Shamim Sarhadi20 wrote:

Great !!

Thank you Mr Martin Morgan

ADD COMMENTlink written 3.7 years ago by Shamim Sarhadi20
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 16.09
Traffic: 413 users visited in the last hour