Skip to contents

This function takes in a data frame and plots the frequency or area of land cover changes as a bar chart. It automatically detects if a column named "Ha" exists, and if so, it plots data using "Ha" as a priority over "Freq". If "Ha" does not exist, it defaults back to using "Freq".

Usage

plot_lcc_freq_bar(lcc_table, col_T1 = NULL, col_T2 = NULL, Freq = NULL)

Arguments

lcc_table

A data frame containing at least two columns of characters and one column of numeric values.

col_T1

First column of characters. If NULL, the function will assign the first column containing characters.

col_T2

Second column of characters. If NULL, the function will assign the second column containing characters.

Freq

Numeric column representing frequencies or areas. If NULL, the function will assign "Ha" if present, otherwise the first numeric column.

Value

A ggplot object showing the frequency or area of land cover changes as a bar chart.

Examples

if (FALSE) {
plot_lcc_freq_bar(lcc_table = luc_top_10, col_T1 = NULL, col_T2 =NULL, Freq =NULL)
}