We can retrieve a subset of data-frame
's value is equal to 1 using the following code.
sub = df[df$col1==1,]
I want to subset a data-frame based on some conditions which are passed as strings
cond = "df$col1==1"
sub = df[cond, ]
The above code doesn't work. Is there any work around to achieve this? How to subset data-frame dynamically?