
Plot French national damage functions
plot_damage_function.Rdplot_damage_function() plots and compares damage functions for a given
sheet and typology across hazard parameters (duration, period, velocity,
salinity). Fixed hazard parameters (single modality) are displayed in the
plot subtitle, while varying parameters are distinguished by color
(damage and period), line type (duration), line width (velocity),
and point symbol (salinity), each in its own legend column.
Arguments
- damage
either a
"damage_function"object or a named list of"damage_function"objects to be compared.- destination
character, path where the plot will be saved if
output_fileis provided. Default totempdir().- output_file
character, name of the output file (
.pdf,.png,.jpg, or.svg). Default toNULL, nothing is saved.- sheet
character, name of the sheet in
damageto be plotted.- typology
character, column name of the sub-type of asset to be plotted.
- duration
character or numeric, flood duration (
d_min) to be plotted. Default toNULL(all available durations insheetare plotted).- period
character or numeric, flood occurrence period (
p_min) to be plotted when present insheet(e.g. for"agriculture"). Default toNULL(all available periods insheetare plotted).- velocity
numeric or character, flood water velocity (
v_min) to be plotted when present insheet. Default toNULL(all available velocities insheetare plotted).- salinity
character, water salinity (
salinite) to be plotted. Default to"non"(NULLplots all available modalities).- unit
character, unit displayed on the y-axis label. Default to
"\u20ac/m\u00b2".- language
character, language used for plot title and axis labels, either
"fr"or"en". Default to"fr".
See also
Other damage function:
get_damage_parameter(),
read_damage_function(),
save_damage_function(),
select_damage()
Examples
if (FALSE) { # \dontrun{
# Example with internal dwelling damage functions
dwelling = list(
initial = read_damage_function("dwelling"),
final = update_damage_function("dwelling")
)
sheet = "logement_surface"
typology = "collectif_immobilier"
plot_damage_function(dwelling[["initial"]], sheet = sheet, typology = typology)
plot_damage_function(dwelling[["final"]], sheet = sheet, typology = typology)
plot_damage_function(dwelling, sheet = sheet, typology = typology)
# Example with internal activity damage functions
activity = list(
initial = read_damage_function("activity"),
final = update_damage_function("activity")
)
sheet = "batiment_surface"
typology = "4332C"
plot_damage_function(activity[["initial"]], sheet = sheet, typology = typology)
plot_damage_function(activity[["final"]], sheet = sheet, typology = typology)
plot_damage_function(activity, sheet = sheet, typology = typology)
sheet = "equipement_stock_employe"
plot_damage_function(activity, sheet = sheet, typology = "4332C", unit = "\u20ac/emp")
plot_damage_function(activity, sheet = "total_employe", typology = "4332C", unit = "\u20ac/emp")
# Example with internal agriculture damage functions
agriculture = read_damage_function("agriculture")
plot_damage_function(
agriculture,
sheet = "parcelle_surface",
typology = "Bl\u00e9 tendre",
unit = "\u20ac/ha"
)
plot_damage_function(
agriculture,
sheet = "parcelle_surface",
typology = "Bl\u00e9 tendre",
period = 14,
velocity = 0.5,
unit = "\u20ac/ha"
)
} # }