We can remove an item from the list using a null assignment:
someList<-list(1,2,3)
someList[2]<-NULL
the same is possible for columns of a data frame, as it is a list object:
someDf<-data.frame(a=1:4,b=2:5)
someDf$a<-NULL
Is it possible to do the same for rows of a data frame or matrix? (I'm looking for a quick method to exclude rows, I cannot vectorize because of the nature of my algorithm, much of which consists of deleting rows, I cannot copy data due to too large a size)
source
share