checkdupl | R Documentation |
Function checkdupl
finds the duplicated row observations between two matrices or data frames.
Function rmdupl
removes the duplicated row observations between two matrices or data frames.
checkdupl(X, Y, nam = NULL, digits = NULL, check.all = FALSE)
rmdupl(X, nam = NULL, digits = NULL, check.all = FALSE)
X |
A matrix or data frame, compared to |
Y |
A matrix or data frame, compared to |
nam |
The names of the variables to consider in |
digits |
The number of digits used when rounding the variables (set in |
check.all |
Logical (default = |
A data frame reporting the duplicated rows.
dat1 <- matrix(c(1:5, 1:5, c(1, 2, 7, 4, 8)), nrow = 3, byrow = TRUE)
dimnames(dat1) <- list(1:3, c("v1", "v2", "v3", "v4", "v5"))
dat2 <- matrix(c(6:10, 1:5, c(1, 2, 7, 6, 12)), nrow = 3, byrow = TRUE)
dimnames(dat2) <- list(1:3, c("v1", "v2", "v3", "v4", "v5"))
dat1
dat2
checkdupl(dat1, dat2)
checkdupl(dat1, dat2, nam = c("v1", "v2"))
checkdupl(dat1, dat2, nam = c("v1", "v2"), check.all = TRUE)
z <- checkdupl(X = dat1, Y = dat1)
z[z$rownum.X != z$rownum.Y, ]
z <- checkdupl(dat1, dat1, nam = c("v1", "v2"))
z[z$rownum.Y != z$rownum.Y, ]
rmdupl(dat1)
rmdupl(dat1, nam = c("v1", "v2"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.