r - Filtering a data frame by values in a column -
this question has answer here:
- filtering data.frame 5 answers
i working dataset learnbayes
. want see actual data:
install.packages('learnbayes')
i trying filter out rows based on value in columns. example, if column value "water", want row. if column value "milk", don't want it. ultimately, trying filter out individuals who's drink column "water".
the subset command not necessary. use data frame indexing
studentdata[studentdata$drink == 'water',]
read warning ?subset
this convenience function intended use interactively. programming better use standard subsetting functions ‘[’, , in particular non-standard evaluation of argument ‘subset’ can have unanticipated consequences.
Comments
Post a Comment