I am trying to remove a row of a dataframe in R however because the dataframe is so large when I use:

rawCounts <- rawCounts[rawCounts != geneID, ]

I get the error:

ERROR in rawCounts[rawCounts != geneID, ]: (subscript) logical subscript too long

Is there another way of removing a specific row in a large dataframe that is not so memory intensive?

Thanks in advance.

I have quite a bit of memory, memory.limit() returns:

> memory.limit()
[1] 16318 

1 Answer 1


I am answering my own question here.

I realised I should have been using

rawCounts <- rawCounts[rownames(rawCounts) != geneID, ]

Problem solved.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.