plot_GRASS | R Documentation |
Given the name of a raster in the current GRASS mapset, this function will plot it as a stars
object.
plot_GRASS(x, colours, out_x, ...)
x |
The name of an object in the current GRASS mapset. |
colours |
Optional. A colour scale. If not supplied, the default settings in |
out_x |
Optional. If supplied, the function makes a call to |
... |
Additional arguments to |
Nothing.
# Will only run if GRASS is running
# You should load rdwplus and initialise GRASS via the initGRASS function
if(check_running()){
# Load data set
dem <- system.file("extdata", "dem.tif", package = "rdwplus")
# Set environment
set_envir(dem)
# Plot
plot_GRASS("dem.tif") # argument must match name of data set in the mapset
plot_GRASS("dem.tif", heat.colors(10)) # with different colour scale
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.