Skip to contents

This function filters rows that have more than one distinct value across all columns except the last one, and then selects the top n rows based on the value of the last column. If a column named "Ha" exists in the data frame, it will be used for sorting the rows, otherwise, it will fall back to the "Freq" column.

Usage

calc_top_lcc(crosstab_result, n_rows)

Arguments

crosstab_result

A data frame of a frequency table (crosstab) of two or more land cover maps. crosstab_result must have a column named "Freq", representing the number of pixels / area for a given land cover change. If a column named "Ha" exists, it will be used instead of "Freq".

n_rows

The number of rows to select.

Value

A data frame containing the top n rows (top n changes).