by_rows and by_cols set properties in horizontal or vertical "stripes".

by_rows(..., from = 1, ignore_na = TRUE)

by_cols(..., from = 1, ignore_na = TRUE)

Arguments

...

One or more cell property values.

from

Numeric. Row or column to start at.

ignore_na

If TRUE, NA values in the result will be left unchanged from their previous values. Otherwise, NA normally resets to the default.

Value

A function for use in map_*** functions.

See also

Examples

ht <- as_hux(matrix(rnorm(25), 5, 5))
map_background_color(ht,
      by_rows("green", "grey"))
#>                   -1.12     0.698     0.622   -0.321    0.463  
#>                   -0.587    1.44      0.694    1.62    -1.1    
#>                   -1.06    -1.73      1.62     0.335   -2.05   
#>                   -0.354   -0.0426    0.983    0.165    1.12   
#>                   -0.691    0.95     -0.593    1.07     0.135  
#> 
#> Column names: V1, V2, V3, V4, V5
map_background_color(ht,
      by_cols("green", "grey"))
#>                   -1.12     0.698     0.622   -0.321    0.463  
#>                   -0.587    1.44      0.694    1.62    -1.1    
#>                   -1.06    -1.73      1.62     0.335   -2.05   
#>                   -0.354   -0.0426    0.983    0.165    1.12   
#>                   -0.691    0.95     -0.593    1.07     0.135  
#> 
#> Column names: V1, V2, V3, V4, V5