Answers.Body: <p>I am answering my own question here. </p>
  
  <p>I realised I should have been using </p>
  
  <pre><code>rawCounts &lt;- rawCounts[rownames(rawCounts) != geneID, ]
  </code></pre>
  
  <p>Problem solved.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-06-11T09:42:58.360Z
Answers.LastActivityDate: 2020-06-11T10:53:57.777Z
Answers.LastEditDate: 2020-06-11T10:53:57.777Z
Answers.UserDisplayName: Jack Henry
Body: <p>I am trying to remove a row of a dataframe in R however because the dataframe is so large when I use:</p>
  
  <pre><code>rawCounts &lt;- rawCounts[rawCounts != geneID, ]
  </code></pre>
  
  <p>I get the error:</p>
  
  <pre><code>ERROR in rawCounts[rawCounts != geneID, ]: (subscript) logical subscript too long
  </code></pre>
  
  <p>Is there another way of removing a specific row in a large dataframe that is not so memory intensive?</p>
  
  <p>Thanks in advance.</p>
  
  <p>I have quite a bit of memory, memory.limit() returns:</p>
  
  <pre><code>&gt; memory.limit()
  [1] 16318 
  </code></pre>
  
Tags: <r>
Title: ERROR: (subscript) logical subscript too long
ThreadText: # ERROR: (subscript) logical subscript too long
  
  (Asked by: username_0 on 2020-06-11)
  
  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 
  
  ```
  
  **Tags:** r
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_0 on 2020-06-11. Score: 2
  
  I am answering my own question here.
  
  I realised I should have been using
  
  ```
  rawCounts <- rawCounts[rownames(rawCounts) != geneID, ]
  
  ```
  
  Problem solved.
  
  
  ---
  
  