This is a test version of Biostars. For the public version, visit https://www.biostars.org.
drop levels in eSet pData

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

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

eset subsetting

1 answer

pData(eset)[ ,"Disease"] <- factor(pData(eset)[ ,"Disease"])

Log in to answer this question.