R/fraction_pie.R

Defines functions fraction_pie

fraction_pie <- function(frac, row) {
	try(pie(x=as.numeric(frac[row,c(2:ncol(frac))]), labels=as.numeric(frac[row,c("bare", "brown", "green", "other")[1:(ncol(frac)-1)]]), main=row, col=c("brown", "orange", "darkgreen", "gray")))
	
	try(legend("topleft", legend=c("Bare ground", "Non-photosynthetic vegetation", "Photosynthetic vegetation", "NA"), pch=20, col=c("brown", "orange", "darkgreen", "gray"), bty="n", cex=0.8, pt.cex=1))
}
ternaustralia/ausplotsR documentation built on Jan. 4, 2024, 8:36 a.m.