R: Save PNG

save_png {rayshader} | R Documentation

## Save PNG

### Description

Writes the hillshaded map to file.

### Usage

    save_png(hillshade, filename, rotate = 0, asp = 1)

### Arguments

`hillshade` | Array (or matrix) of hillshade to be written.
`filename` | String with the filename. If '.png' is not at the end of the string, it will be appended automatically.
`rotate` | Default 0. Rotates the output. Possible values: 0, 90, 180, 270.
`asp` | Default '1'. Aspect ratio of the resulting plot. Use 'asp = 1/cospi(mean_latitude/180)' to rescale lat/long at higher latitudes to the correct the aspect ratio.

### Examples

    filename_map = tempfile()

    #Save the map into `filename_map`
    montereybay %>%
     sphere_shade() %>%
     save_png(filename_map)

    #Rotate the map 180 degrees:

    montereybay %>%
     sphere_shade() %>%
     save_png(filename_map,rotate=180)

[Package rayshader version 0.19.2 Index]