Filter data based on clients and validate
filter_data.Rd
filter_data()
filters the provided dataset to include only records that match
the given clients_filtered
dataset at the specified level (enrollment or youth).
It then validates the filtered dataset to ensure it is not empty.
Arguments
- data
A data frame to be filtered
- clients_filtered
A data frame containing the client records to filter
data
by. Must contain columns that match the selectedat
level.- at
A character string specifying the filtering level. Either
"enrollment"
(default) or"youth"
."enrollment"
: Filters data based onpersonal_id
,organization_id
andenrollment_id
."youth"
: Filters data based onpersonal_id
andorganization_id
.