# Will only run if GRASS is running
if(check_running()){
# Load data set
dem <- system.file("extdata", "dem.tif", package = "rdwplus")
# Set environment parameters
set_envir(dem)
# Read in data
raster_to_mapset(dem)
# Set coordinates to rasterise
coord_df <- c(1098671, 6924794)
# Convert to raster
coord_to_raster(outlet = coord_df, out = "coords", overwrite = TRUE)
# Plot
plot_GRASS("dem.tif", col = topo.colors(15))
plot_GRASS("coords", col = "red", add = TRUE)
}
Run the code above in your browser using DataLab