-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathappend_group.Rd
28 lines (25 loc) · 1.17 KB
/
append_group.Rd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/append_group.R
\name{append_group}
\alias{append_group}
\title{Append Group}
\usage{
append_group(df, group_var, formula, drop = FALSE)
}
\arguments{
\item{df}{data.frame or data.table}
\item{group_var}{unquoted variable name of categorical variable}
\item{formula}{a formula, LHS ~ RHS. The LHS side denotes the new level label. The RHS denotes the categories to be combined. For example: \code{`Species starting with V` ~ versicolor + verginica}.}
\item{drop}{TRUE/FALSE. If FALSE, the resulting dataframe will include the original data plus observations with the new category level (rows will be duplicated). If TRUE, the command will eliminate rows in the original data with the old category levels (rows are not duplicated). Default is FALSE.}
}
\description{
Creates a new category level by combining existing levels. Appends new observations to dataset.
}
\examples{
append_group(iris, `Species starting with V` ~ versicolor + virginica)
append_group(iris, `Species starting with V` ~ versicolor + virginica, drop = TRUE)
}
\keyword{categorical}
\keyword{combine}
\keyword{levels}
\keyword{variables,}