You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Because we have stuffed the actual tibbles associated with a pat object inside of pat$meta and pat$data we cannot use dplyr filtering on our pat object.
So we need a pat_filter() function which applies the incoming filtering expression to pat$data and returns the modified pat object.
Using pat_filter() should feel just like working with dplyr::filter().
See PWFSLSmoke::monitor_subsetBy() for example code for how to do this.
We already have a pat_filterDate() function that simplifies things for the most common usage and we should provide pat_filterData() that is more general just to be complete.
For extra-completeness, we should have a pat_filter() function that just wraps pat_filterData().
That seems like a good API for end users:
~_filter() -- wrapper for ~_filterData() for those expecting dplyr::filter()
~_filterDate() -- convenience function; just specify user friendly startdate and enddate
~_filterData() -- explicit; does just what it says
The text was updated successfully, but these errors were encountered:
This can be done using dplyr - so it acts just like dplyr! Keep in mind, returning a pat object does not play well with pipeing as dplyr expects a data.frame. i.e. pat %>% pat_filterData(something>else) %>% group_by(etc) will throw an error.
Because we have stuffed the actual tibbles associated with a
pat
object inside ofpat$meta
andpat$data
we cannot use dplyr filtering on ourpat
object.So we need a
pat_filter()
function which applies the incoming filtering expression topat$data
and returns the modifiedpat
object.Using
pat_filter()
should feel just like working withdplyr::filter()
.See
PWFSLSmoke::monitor_subsetBy()
for example code for how to do this.We already have a
pat_filterDate()
function that simplifies things for the most common usage and we should providepat_filterData()
that is more general just to be complete.For extra-completeness, we should have a
pat_filter()
function that just wrapspat_filterData()
.That seems like a good API for end users:
~_filter()
-- wrapper for~_filterData()
for those expectingdplyr::filter()
~_filterDate()
-- convenience function; just specify user friendlystartdate
andenddate
~_filterData()
-- explicit; does just what it saysThe text was updated successfully, but these errors were encountered: