...
Code Block | ||
---|---|---|
| ||
# Load the ForestForesight package library(ForestForesight) # Get the countries data and convert it to a spatial vector countries <- vect(get(data("countries"))) # Open a new graphics device in full screen mode x11(fullscreen = TRUEwidth=15,height=15) # Plot all countries for which we have predictions plot(countries) # Allow the user to click on a country to select it # n=1 means we're selecting just one country country <- click(countries, n=1) # Extract the shape of the selected country # We use the ISO3 code to match the selected country shape <- countries[countries$iso3 == country$iso3] |
...