Closed chriswyatt1 closed 3 months ago
Hi @chriswyatt1,
You do not need the line:
og_tab <- classif
so change code to utilise dataframe variable that already existstop10 <- head(sums\$order, n = 10)
change to what we discussed about the percentagesums <- aggregate(size~order,og_tab,sum)
sums <- sums[order(sums\$size, decreasing = TRUE),]
top10 <- head(sums\$order, n = 10)
sums <- sums %>% mutate(legend_value = case_when(order %in% top10 ~ order, !(order %in% top10) ~ "OTHER" ))
pie_table <- aggregate(size~legend_value,sums,sum)
This entire section could be made into a function as it is repeated 3 times, so just provide input to a function of (order, family and genus)
New container for r-processing (from Simon) New pie chart code and written into results folder to give a rough visual of the classifications.