% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/dupl_show.R
\name{dupl_show}
\alias{dupl_show}
\title{Show observations of all duplicated values of a variable or a combination of variables}
\usage{
dupl_show(data_frame, vars)
}
\arguments{
\item{data_frame}{Data.frame. Input data frame. Must be in the Global Environment and has a data.frame class}

\item{vars}{Character. Vector of variable or combination of variables
from which duplicates are checked}
}
\value{
Data.frame. The part of inputted data frame with all observations of duplicated values of
indicated variable or combination of variables
}
\description{
Show observations of all duplicated values of a variable or a combination of variables
}
\examples{
# A fictional data with duplicated values:
df <- data.frame("person_id" = c(1, 1, 2, 3,
                                 2, 4, 5, 5 ,1),
                 "person_age" = c(25, 25, 21, 32,
                                  21, 48, 50, 50, 52),
                 "survey_month" = c("jan", "feb", "mar", "apr",
                                    "apr", "may", "jun", "jul", "jan"),
                 "survey_answer" = c("no", "yes", "no", "yes",
                                     "yes", "yes", "no", "yes", NA))

# Shuffling observations and columns to make duplicates difficult to see:
set.seed(1)
df <- df[sample(1:nrow(df)),
         sample(1:ncol(df))]
df

# See all of the rows where person_id has more than an unique possible value: 
dupl_show(data = df, var = "person_id")

# See all of the rows where the combination of person_id and survey_month variables has 
# more than an unique possible value : 
dupl_show(data = df, var = c("person_id", "survey_month"))
}
