dupes_tag: Tabulate Covariate Patterns

Description Usage Arguments Value Author(s) Examples

Description

dupes_tag is similar to the duplicates tag function in STATA. It takes in a data frame and returns that data frame with a an additional column labeled 'dupes'. Dupes is the count of all other observations that have the same covariate pattern in the columns listed in ...

Usage

1

Arguments

df

a data frame

...

any number of columns of df. Must be listed in quotes

Value

a numeric vector

Author(s)

Sven Halvorson (svenedmail@gmail.com)

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
library("dplyr")
#create a little test set

test.set = data.frame(v1 = sample(x = c("A","B","C"),size = 20, replace = TRUE),
                      v2 = sample(x = 1:2, size = 20, replace = TRUE),
                      v3 = sample(x = c("foo", "bar"), size = 20, replace = TRUE))
test.set = arrange(test.set,v1,v2,v3)

test.set$dupes = dupes_tag(test.set,"v1","v2","v3")
test.set

svenhalvorson/SvenSFPS documentation built on May 21, 2019, 11:42 a.m.