R/view_results.R
view_results.Rd
To quickly inspect the mapspamc
results, view_results()
shows crop
distribution maps for a selected crop using a panel for each production system.
This function works after combine_results()
is run. There is no need to
run create_all_tif()
. The maps are visualized using
leafletjs, which makes it possible to select a
number of background tiles (e.g. OpenStreetMap).
view_results(crp, var, param, viewer = TRUE, polygon = TRUE)
Character. Crop for which the maps are shows. crp
has to be
one of the mapspamc
four letter crop codes.
Character. The variable to be plotted. var
has to be physical
area ("pa"
) or harvested area ("ha"
).
Object of type mapspamc_par
that bundles all mapspamc
parameters,
including core model folders, alpha-3 country code, year, spatial
resolution, most detailed level at which subnational statistics are
available, administrative unit level at which the model is solved and type of
model.
Logical. Should the default web browers be used to show the
maps? FALSE
will show the maps in the RStudio viewer pane.
Logical; should the country polygon be overlayed?
if (FALSE) {
view_results(crop = "maiz", var = "ha", viewer = FALSE, polygon = FALSE)
}