Draw polyline on a nativeRaster image

nr_polyline(nr, x, y, color = "black", close = FALSE)

Arguments

nr

nativeRaster

x, y

Vectors of point coordinates

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

close

Should the polyline be closed? I.e. should a line be drawn between the last point and the first point? Default: FALSE

Value

Original nativeRaster modified in-place

Examples

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