Learn R Programming

peacesciencer (version 1.1.0)

show_duplicates: Show Duplicate Observations in Your Dyad-Year or State-Year Data Frame

Description

show_duplicates() shows which data are duplicated in data generated in peacesciencer. It's a useful diagnostic tool for users doing some do-it-yourself functions with peacesciencer.

Usage

show_duplicates(data)

Value

show_duplicates() takes a dyad-year data frame or state-year data frame generated in peacesciencer and shows what observations are duplicated by unique combination of dyad-year or state-year, contingent on what was supplied to it.

Arguments

data

a dyad-year data frame or a state-year data frame created in peacesciencer.

Author

Steven V. Miller

Details

The function leans on attributes of the data that are provided by the create_dyadyear() or create_stateyear() function. Make sure that function (or data created by that function) appear at the top of the proverbial pipe.

The data returned will also have a new column called duplicated. Thus, an implicit assumption in this function is the user does not have a column in the data with this name that is of interest to the user. It will be overwritten.

Examples

Run this code

# just call `library(tidyverse)` at the top of the your script
library(magrittr)

gml_dirdisp %>% show_duplicates()
cow_mid_dirdisps %>% show_duplicates()

Run the code above in your browser using DataLab