Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

before

is an element before a match with entries


Description

return a logical vector of the same length as x, indicating if elements are located before a set of entries to match or not.

Usage

before(x, entries)

Arguments

x

an atomic vector of values to be tested

entries

a sequence of items to be searched in x.

See Also

Examples

library(flextable)
library(officer)

dat <- data.frame(
  stringsAsFactors = FALSE,
  check.names = FALSE,
  Level = c("setosa", "versicolor", "virginica", "<NA>", "Total"),
  Freq = as.integer(c(50, 50, 50, 0, 150)),
  `% Valid` = c(100/3,
                100/3,100/3,NA,100),
  `% Valid Cum.` = c(100/3, 100*2/3, 100, NA, 100),
  `% Total` = c(100/3,
                100/3,100/3,0,100),
  `% Total Cum.` = c(100/3,
                     100*2/3,100,100,100)
)

ft <- flextable(dat)
ft <- hline(ft, i = ~ before(Level, "Total"),
            border = fp_border_default(width = 2))
ft

flextable

Functions for Tabular Reporting

v0.6.10
GPL-3
Authors
David Gohel [aut, cre], Clementine Jager [ctb], Quentin Fazilleau [ctb], Maxim Nazarov [ctb] (rmarkdown for docx output), Titouan Robert [ctb], Michael Barrowman [ctb] (inline footnotes), Atsushi Yasumoto [ctb] (support for bookdown cross reference), Paul Julian [ctb] (support for gam objects)
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.