How to calculate the heterogeneity of a variable which is divided into three separate columns in R

15 views Asked by At

I have the variable proportion of vegetation height for each transect in a field study, which is categorized into vegetation below 5cm, between 5 and 15cm, and over 15cm. Since each measure is a proportion, when they are added they add up to 100 (except some cases which have to do with the experimental design).

df <- structure(list(vegunder5cm = c(37.4, 29.0153846153846, 43.2753623188406, 
36, 29.622641509434, 47.28, 17.8, 3, 26.3114754098361, 0), vegbw5and15cm = c(43.4, 
14.9076923076923, 25.5507246376812, 23.9090909090909, 24.0377358490566, 
13.56, 30.4, 28.2, 19.0327868852459, 30), vegover15cm = c(19.2, 
56.0769230769231, 31.1739130434783, 40.0909090909091, 46.3396226415094, 
39.16, 51.8, 66.55, 54.655737704918, 70), mean_height = c(9.09, 
11.3530769230769, 9.39492753623188, 10.2045454545455, 10.8358490566038, 
9.594, 11.7, 13.2506393861893, 11.4172131147541, 13.5)), row.names = c(NA, 
10L), class = "data.frame")

I want to determine which transects have greater heterogeneity in vegetation height and which are more even, though I'm not sure of the proper function for this. I was thinking of calculating the standard deviation of the mean but am not sure how to do this across columns. The mean would be the same anyway (33.33).

0

There are 0 answers