% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/merge_flextable.R
\name{merge_h}
\alias{merge_h}
\title{Merge flextable cells horizontally}
\usage{
merge_h(x, i = NULL, part = "body")
}
\arguments{
\item{x}{a 'flextable' object, see \link{flextable-package} to learn how to create
'flextable' object.}

\item{i}{row selector, see section \emph{Row selection with the \code{i} parameter}
in <\code{\link[=flextable_selectors]{Selectors in flextable}}>.}

\item{part}{part selector, see section \emph{Part selection with the \code{part}
parameter} in <\code{\link[=flextable_selectors]{Selectors in flextable}}>.
Value 'all' is not allowed by the function.}
}
\description{
Merge flextable cells horizontally when consecutive cells have
identical values. Text of formatted values are used to compare
values.
}
\examples{
library(flextable)

schedule <- data.frame(
  time = c("9h", "10h", "11h", "14h", "15h", "16h"),
  monday = c("Math", "Math", "French", "History", "Science", "French"),
  tuesday = c("English", "Math", "Art", "Math", "Math", "French"),
  wednesday = c("Science", "Math", "Science", "English", "English", "French"),
  stringsAsFactors = FALSE
)

ft <- flextable(schedule)
ft <- theme_box(ft)
ft <- merge_h(ft)
ft
}
\seealso{
Other cell merging functions:
\code{\link[=merge_at]{merge_at()}},
\code{\link[=merge_h_range]{merge_h_range()}},
\code{\link[=merge_none]{merge_none()}},
\code{\link[=merge_v]{merge_v()}}
}
\concept{cell merging functions}
