
Plot Predicted Suitability for All Countries
Source:R/plot_suitability_by_country.R
plot_suitability_by_country.RdThis function generates a facet plot of predicted environmental suitability for all countries over time. Requires that est_suitability() has been run first to generate the necessary prediction files.
Value
A facet plot of predicted environmental suitability for all countries, filtered to years >= 2021. The plot includes suitability predictions with separate colors for historical (black) and future (orange) predictions.
Details
The function reads pred_psi_suitability_week.csv created by est_suitability()
(columns iso_code, year, date and psi) and plots the canonical psi
column (smoothed and bias-corrected), the series that becomes the engine's
psi_jt. A pre-v0.34 file without psi falls back to
pred_smooth, with a message.