I have data frame in following format
Question Year
filter with question? 2010
keep this row 2009
keep this row too 2008
remove this one? 2007
expected results
Question Year
keep this row 2009
keep this row too 2008
Get the subset of data frame excluding column Question contains question mark '?'.
We can use grep to filter out the ? elements in 'Question' column
df1[!grepl('\\?', df1$Question),]
# Question Year
#2 keep this row 2009
#3 keep this row too 2008
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With