Create an area to apply formatter

Share:

Description

Create an representation of two-dimenstional area to apply formatter function. The area can be one or more columns, one or more rows, or an area of rows and columns.

Usage

1

Arguments

row

an expression of row range. If missing, TRUE is used instead.

col

an expression of column range. If missing, TRUE is used instead.

Details

The function creates an area object to store the representation of row and column selector expressions. When the function is called, the expressions and environment of row and column are captured for format_table to evaluate within the context of the input data.frame, that is, rownames and colnames are defined in the context to be the indices of rows and columns, respectively. Therefore, the row names and column names are avaiable symbols when row and col are evaluated, respectively, which makes it easier to specify range with names, for example, area(row = row1:row10, col = col1:col5).

See Also

format_table, formattable.data.frame

Examples

1
2
3
4
5
area(col = c("mpg", "cyl"))
area(col = mpg:cyl)
area(row = 1)
area(row = 1:10, col = 5:10)
area(1:10, col1:col5)

Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.