data(LeafSizeDist)
CulmNumber <- c()
for(i in 1:length(LeafSizeDist$Code)){
temp <- as.numeric( strsplit(LeafSizeDist$Code[i],"-", fixed=TRUE)[[1]][1] )
CulmNumber <- c(CulmNumber, temp)
}
uni.CN <- sort( unique(CulmNumber) )
ind <- CulmNumber==uni.CN[1]
A0 <- LeafSizeDist$A[ind]
A1 <- sort( A0 )
x1 <- 1:length(A1)/length(A1)
y1 <- cumsum(A1)/sum(A1)
x1 <- c(0, x1)
y1 <- c(0, y1)
M0 <- LeafSizeDist$M[ind]
M1 <- sort( M0 )
x2 <- 1:length(M1)/length(M1)
y2 <- cumsum(M1)/sum(M1)
x2 <- c(0, x2)
y2 <- c(0, y2)
dev.new()
plot(x1, y1, cex.lab=1.5, cex.axis=1.5, type="l",
xlab="Cumulative proportion of the number of leaves",
ylab="Cumulative proportion of leaf area")
lines(c(0,1), c(0,1), col=4)
dev.new()
plot(x2, y2, cex.lab=1.5, cex.axis=1.5, type="l",
xlab="Cumulative proportion of the number of leaves",
ylab="Cumulative proportion of leaf dry mass")
lines(c(0,1), c(0,1), col=4)
graphics.off()
Run the code above in your browser using DataLab