library(rayshader)
# Create elevation matrix
el_mat <- raster_to_matrix(maungawhau)
el_mat %>%
# Create hillshade layer using
# ray-tracing
ray_shade() %>%
# Add ambient shading
add_shadow_2d(
ambient_shade(
heightmap = el_mat
)
)
Run the code above in your browser using DataLab