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")
)
#>                    -0.668   -0.789   -0.233   -0.683    0.748  
#>                     1.39     0.588    0.637   -0.98     3.39   
#>                     0.912   -0.711   -1.37    -0.463    1.62   
#>                     0.205    1.58    -1.43     1.21    -1.85   
#>                     2.58     0.676   -1.25    -1.28     1.06   
#> 
#> Column names: V1, V2, V3, V4, V5
map_background_color(
  ht,
  by_cols("green", "grey")
)
#>                    -0.668   -0.789   -0.233   -0.683    0.748  
#>                     1.39     0.588    0.637   -0.98     3.39   
#>                     0.912   -0.711   -1.37    -0.463    1.62   
#>                     0.205    1.58    -1.43     1.21    -1.85   
#>                     2.58     0.676   -1.25    -1.28     1.06   
#> 
#> Column names: V1, V2, V3, V4, V5