A marker scheme maps one value to a shape family and another to a variant.
Regular markers combine the two names with a hyphen. One-time values map
directly to a marker, while none uses the scheme's fallback marker.
Arguments
- start, stop
Vectors of values used to select shape family and variant. Numeric, character, and factor values are accepted. Values may be missing on rows selected by
onceornonewhen they are not needed.- once, none
Logical vectors marking one-time and no-screening rows. Scalars are recycled. The two flags cannot both be
TRUEon a row.- scheme
"sda2028"or a list with named character vectorsstart,stop, andonce, plus one character scalarnone. Thestartandstopvalues are marker-name parts;onceandnoneare complete icon names. Schemes may use bundled markers or user SVG names.
Details
The built-in "sda2028" scheme uses screening start ages 45/50/55 for
square/circle/diamond and stop ages 70/75/80/85 for
inset/hollow/cross/solid. One-time screening uses solid markers at ages
45/50/55, "plus-bold" at 60, and "triangle-down" at 65.
Examples
marker_encode(c(45, 50, NA), c(70, 85, NA), none = c(FALSE, FALSE, TRUE))
#> [1] "square-inset" "circle-solid" "circle-solid"
marker_encode(c(45, 60), c(NA, NA), once = TRUE)
#> [1] "square-solid" "plus-bold"
other <- list(
start = c(A = "square"), stop = c(B = "hollow"),
once = c(A = "square-solid"), none = "circle-solid"
)
marker_encode("A", "B", scheme = other)
#> [1] "square-hollow"
