Draw rectangles on a nativeRaster image

nr_rect(nr, x, y, w, h, fill = "black", color = NA)

Arguments

nr

nativeRaster

x, y

coordinates of lower left corner of rectangle. [vector]

w, h

width and height of rectangle. [vector]

fill

interior fill color [vector]

color

outline color. Default: NA. [vector]

Value

Original nativeRaster modified in-place

Examples

N <- 20
nr <- nr_new(N, N, 'grey80')
nr_rect(nr, x = c(1, N/2 + 1), y = c(1, N/2 + 1), w = N/2, h = N/4, 
        fill = 'blue', color = c('red', 'green'))
plot(nr)