r - How to delete specific rows with while? -


i'm beginner in r , need help:

in database, big since i'm working micro-data, want remove rows when there specific value of column...i trying implement function that....but i'm having problem if condition(true/false problem). example, want remove row when column disc in line "l", did function:

dellinhas<-function(x){    n<-nrow(x)   i<-1   while (i<=n) {   if (x[i,]$disc=="l") {x<-x[-(i:i),]}   i<-i+1}   dadosprmm<-x } 

where x database. doing wrong?

use subscripting:

x[x$disc != "l",] 

and try website basic data manipulation issues: http://www.statmethods.net/


Comments

Popular posts from this blog

c# - how to write client side events functions for the combobox items -

exception - Python, pyPdf OCR error: pyPdf.utils.PdfReadError: EOF marker not found -