Calculate the difference of area under the curve (AUC) between two curves, normalised by the total area of the graph.

AUC_of_cross_function(df.cross)

Arguments

df.cross

Data.frame. The output of calculate_cross_functions. Containing the positions of the two curves. Columns contain "r", "border" and "theo".

Value

A number

Examples

df_cross <- calculate_cross_functions(SPIAT::defined_image, method = "Kcross",
              cell_types_of_interest = c("Tumour","Immune3"),
              feature_colname ="Cell.Type", dist = 100)

AUC_of_cross_function(df_cross)
#> [1] 0.05170332