by_rows and by_cols set properties in horizontal or vertical "stripes".
See also
Other mapping functions:
by_cases(),
by_colorspace(),
by_function(),
by_quantiles(),
by_ranges(),
by_regex(),
by_values()
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