title: Create separate DF with data from original - remove original data at same time
body: <p>I am trying to move test DF data to test2 DF data in one code chunk - Right now, I have this going as two separate code chunks - the top one creates the test2 data from test data. Then the bottom chunk simply removes that same data from test.</p>
  <pre><code>test2 &lt;- test[0,colnames(test)]
  test2 &lt;- test[nchar(test$insert_text1) != 10 | 
                  grepl(pattern = &quot;text1&quot;, x = test$insert_text2`, ignore.case = T) == FALSE | 
                  grepl(pattern = &quot;text2&quot;, x = test$insert_text3, ignore.case = T) == TRUE |
                  is.na(test$insert_text1),]
  
  test &lt;- test[-c(nchar(test$insert_text1) != 10 | 
                    is.na(test$insert_text1) |
                    grepl(pattern = &quot;text2&quot;, x = test$insert_text2, ignore.case = T) == TRUE |
                    grepl(pattern = &quot;text1&quot;, x = test$insert_text1, ignore.case = T) == FALSE) == FALSE,]
  </code></pre>
  <p>Thank you!</p>