#Here we produce a light intensity map of the `volcano` elevation map.
#Cache the normal vectors of the volcano dataset
if(run_documentation()) {
volcanocache = calculate_normal(volcano)
}
#Use the cached vectors to speed up calculation of `sphere_shade()` on a map.
if(run_documentation()) {
sphere_shade(volcano,normalvectors = volcanocache) %>%
plot_map()
}
Run the code above in your browser using DataLab