dedupe_MA: Remove Duplicate Rows for Meta-Analysis

View source: R/dedupe_MA.R

dedupe_MAR Documentation

Remove Duplicate Rows for Meta-Analysis

Description

dedupe_MA() removes duplicate rows to retain the largest available meta-analysis group. It was adapted from the now depreciated cedarr package for Sawmill.

Usage

dedupe_MA(query)

Arguments

query

a tibble of timber, with a table built by build_table.

Details

A factor may be included in more than one meta-analysis. For example, a factor describing resistance to a third-generation cephalosporin may be included in a meta-analysis across other third-generation cephalosporins, but may also be included in a larger meta-analysis across all cephalosporins. Where a factor is included in multiple meta-analyses applicable to a query, duplicate rows will be returned. The dedupeMA function removes these duplicate rows, retaining the largest meta-analysis group available. If the groups are of the same size, they are both retained. The dedupeMA function first separates those rows involved in meta-analysis from those uninvolved into two tibbles. It then searches for duplicate factors. If duplicates exist, the associated meta-analyses are identified for each duplicate, and the size of each meta-analysis is determined. Those which are not the largest are dropped from the 'involved' tibble, and the two tibbles are then reunited.

Value

A tibble of timber, with duplicate rows removed.


iAM-AMR/sawmill documentation built on June 30, 2024, 2:25 a.m.