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.
area(row, col)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).
area(col = c("mpg", "cyl"))
#> $row
#> [1] TRUE
#>
#> $col
#> c("mpg", "cyl")
#>
#> $envir
#> <environment: 0x562959338578>
#>
#> attr(,"class")
#> [1] "area"
area(col = mpg:cyl)
#> $row
#> [1] TRUE
#>
#> $col
#> mpg:cyl
#>
#> $envir
#> <environment: 0x562959338578>
#>
#> attr(,"class")
#> [1] "area"
area(row = 1)
#> $row
#> [1] 1
#>
#> $col
#> [1] TRUE
#>
#> $envir
#> <environment: 0x562959338578>
#>
#> attr(,"class")
#> [1] "area"
area(row = 1:10, col = 5:10)
#> $row
#> 1:10
#>
#> $col
#> 5:10
#>
#> $envir
#> <environment: 0x562959338578>
#>
#> attr(,"class")
#> [1] "area"
area(1:10, col1:col5)
#> $row
#> 1:10
#>
#> $col
#> col1:col5
#>
#> $envir
#> <environment: 0x562959338578>
#>
#> attr(,"class")
#> [1] "area"