if (requireNamespace("magick")) {
x_hex <- 0.5 + 0.5 * cos(seq(2 * pi / 4, by = 2 * pi / 6, length.out = 6))
y_hex <- 0.5 + 0.5 * sin(seq(2 * pi / 4, by = 2 * pi / 6, length.out = 6))
grid.pattern_magick(x_hex, y_hex, type="octagons", fill="blue", scale=2)
}
# supported magick pattern names
print(names_magick)
Run the code above in your browser using DataLab