Returns ids coverage per value track.

emr_ids_vals_coverage(ids, tracks, stime = NULL, etime = NULL, filter = NULL)

Arguments

ids

track name or Ids Table

tracks

a vector of track names

stime

start time scope

etime

end time scope

filter

iterator filter

Value

A data frame containing the number of ids for each track value.

Details

This function accepts a set of ids and a vector of categorical tracks. For each track value it calculates how many ids share this value. Each id is counted only once. A data frame with 3 columns 'track', 'val' and 'count' is returned.

Ids can originate from a track or be provided within Ids Table.

Note: The internal iterator that runs over each track is defined with 'keepref=TRUE'.

Examples


emr_db.init_examples()
#> NULL
emr_ids_vals_coverage(data.frame(id = c(15, 24, 27)), "categorical_track")
#>               track val count
#> 1 categorical_track   0     0
#> 2 categorical_track   1     0
#> 3 categorical_track   2     2
#> 4 categorical_track   3     2
#> 5 categorical_track   4     1