It computes the number of modifications between the raw binerised Spatraster and the Spartraster produced using the BEE.id.extreme_events().

BEE.calc.corrections(true_event_raster, true_event_df_list, plot = TRUE)

Arguments

true_event_raster

: The first element of the BEE.id.extreme_events() ouput, which is a spatraster binarized that inclued the corrections by BEE.id.extreme_events().

true_event_df_list

: The second element of the BEE.id.extreme_events() ouput, which is a list of data.table containing information about the value of each pixel before and after definition criteria are applied to distinguish isolated extreme days from extreme events.

plot

: Accepted values are TRUE of FALSE. Set to “FALSE” to not display the graphs.

Value

In R consol it returns a message with the number of 1 corrected to 0 and the number of 0 corrected to 1. If plot=TURE it shows the cumulative percentage of changes through time. The object return if a dataframe with one line percombinaison of date and pixel_id. The dataframe has the same structure than the ones in true_event_df_list.

Examples

# Prepare function arguments:
file_name_1 <- system.file(file.path("extdata",
                                     "binarized_corrected_spatraster.tiff"),
                                     package = "BioExtremeEvent")
binarized_corrected_spatraster <- terra::rast(file_name_1)
file_name_2 <- system.file(file.path("extdata",
                                     "binarized_corrected_df.rds"),
                                     package = "BioExtremeEvent")
binarized_corrected_df <- readRDS(file_name_2)
# Run function
df_bonus <- BEE.calc.corrections(
 true_event_raster = binarized_corrected_spatraster,
 true_event_df_list = binarized_corrected_df,
 plot = TRUE
)
#> Number of 0 corrected to 1: 1706
#> Number of 1 corrected to 0: 22628
#> Percentage of non NA values corrected from 0 to 1: 0.45318344100646
#> Percentage of non NA values corrected from 1 to 0: 6.01092315538932
#> 6.46410659639578 % of the non NA values have been modified.