raster_write(x, path, width = 480, height = 480, interpolate = FALSE)
r <- as.raster(matrix(hcl(0, 80, seq(50, 80, 10)), nrow = 4, ncol = 5)) raster_write(x = r, path = "raster.png", width = 50, height = 50)
Run the code above in your browser using DataLab