% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/removeReplicatedColumns.R
\name{removeReplicatedColumns}
\alias{removeReplicatedColumns}
\title{Drop and merge replicated columns from the specified data frame.}
\usage{
removeReplicatedColumns(dataframe, prefix)
}
\arguments{
\item{dataframe}{\code{data.frame}. The data frame from which to drop the
replicated columns.}

\item{prefix}{\code{character} (string). The prefix with which the name of the
replicated columns starts.}
}
\value{
The specified data frame with an additional deduplicated column and
all the types transformed to string.
}
\description{
This function drops and merges all the replicated columns from the specified
data frame.
}
\details{
All the occurrences of "N/A", "NA", and empty strings (case insensitive)
inside the provided data frame are replaced with NAs of type character.
Then, all and only the columns starting with the specified prefix are
selected and united into a single column with name ending per
"_deduplicated". All empty entries in the new deduplicated column are
replaced with NAs. Finally, the new column is bound with the other columns of
the initial dataframe.
}
\examples{
irisTest_ <- iris
irisTest_$Species_1 <- irisTest_$Species
irisTest_$Species_2 <- irisTest_$Species
irisTest_$Species <- NULL

deduplicatedDataframe_ <- removeReplicatedColumns(
  dataframe = irisTest_,
  prefix = "Species_")

}
