AndTheDaysGoBy / ForFun

Just a repo where I post some things that have come to mind, and I've attempted to create.
0 stars 0 forks source link

Autogenerate Code For Filters #3

Closed AndTheDaysGoBy closed 6 years ago

AndTheDaysGoBy commented 6 years ago

Since the filters have to be applied successively, daply() wouldn't work. Using the plyr package's filter(condition1, ..., conditionN) would work, except for the fact that the code can't be written since the number of filters is arbitrary. The issue is to find a means to "on the fly" for each filter generate its code (but not evaluate it since it wouldn't understand it because the filter conditions reference dataframe columns) and then pass in this variable to filter. This might make use of parse(), i.e. generate it as a string, but then parse it for filter to use.

AndTheDaysGoBy commented 6 years ago

By self-defining function which return various Boolean operators, the goal of "input dependent Boolean expressions" is achieved.