Draw polygon on a nativeRaster image

nr_polygon(nr, x, y, fill = "black", color = NA)

Arguments

nr

nativeRaster

x, y

Vectors of point coordinates

fill

fill color [scalar]

color

Color as a character string. Either a standard R color (e.g. 'blue', 'white') or a hex color of the form #rrggbbaa, #rrggbb, #rgba or #rgb

Value

Original nativeRaster modified in-place

Examples

N <- 20
nr <- nr_new(N, N, 'grey80')
nr_polygon(nr, x = c(1, N, 1), y = c(1, 1, N), fill = 'blue', color = 'red')
plot(nr)