Skip to contents

read_damage_function() reads damage function from a xls file, typically downloaded from the official repository.

Usage

read_damage_function(x)

Arguments

x

character string, representing the filepath to the damage function file. Can be a keywords. See details.

Value

An object of class "damage_finction", which is a list with 2 named slots :

  • slot "wb", which contains the workbook as returned by openxlsx2::wb_load()

  • slot "sheet", contains a selection of the sheets in "wb" :

    • "version", the sheet that gives data on the damage_function version and how to update data

    • "description", the sheet that describes all sheets with data

    • "notice", the sheet that describes how to use the data

    • other named slots that depends on the "damage_function" type and that may be updated.

Details

x can be a keywords within "dwelling", "activity", "public", "sewage". In that case, read_damage_function() read available damage functions within library.

Examples


# Read data from default value
path_dwelling = system.file("extdata", "damage_function/dwelling.xlsx", package = "floodam.data")
dwelling = read_damage_function(path_dwelling)
dwelling = read_damage_function("dwelling")

activity = read_damage_function("activity")

public = read_damage_function("public")

sewage = read_damage_function("sewage")