filter_memberships | R Documentation |
filter_memberships
is a function to find all memberships in one
dataframe that intersect with those in another data frame for each person,
or other entity. This function lets you find things like all committee
memberships for Commons Members during the period they have served as an MP,
or all government roles held by Members of the House Lords while they have
served in the Lords.
filter_memberships(
tm,
fm,
tm_id_col,
tm_start_col,
tm_end_col,
fm_start_col,
fm_end_col,
join_col
)
tm |
A tibble containing the target memberships. These are the memberships to be filtered. |
fm |
A tibble containing the filter memberships. These are the memberships that are used to filter the target memberships. |
tm_id_col |
The name of the column in the target memberships that contains the target membership id. |
tm_start_col |
The name of the column in target memberships that contains the start date for the membership. |
tm_end_col |
The name of the column in target memberships that contains the end date for the membership. |
fm_start_col |
The name of the column in filter memberships that contains the start date for the membership. |
fm_end_col |
The name of the column in filter memberships that contains the end date for the membership. |
join_col |
The name of the column in both the target and filter memberships that contains the id of the entity that is common to both tables. Where the entity is a person this will be the person id. |
A tibble with the same structure as the input tm containing the rows that meet the filtering criteria.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.