source("./wpopdata.R") BP <- 2001 - YEAR POP <- POP*1000000 LPOP <- log10(POP) LBP <- -log10(BP) reg <- lm(LPOP~LBP) par(family="sans",mfrow=c(1,2)) plot(LBP,LPOP,type="p",axes=F,xlab=expression(-log[10](BP)),ylab=expression(log[10](POP)),main=paste("Y=",formatC(reg$coefficient[[1]],width=5),"+",formatC(reg$coefficient[[2]],width=5),"X")) axis(1,at = my.at <- c(-7,-6,-5,-4,-3,-2,-1,0), labels=formatC(my.at,format="fg")) axis(2,at = my.at <- c(2:10), labels=formatC(my.at,format="fg")) abline(reg,col="red") plot(-BP,POP,type="p",xlab="- \"Years before present (=BP)\"",ylab="World population (=POP)",axes=F) axis(1,at = my.at <- c(-1000000,-800000,-600000,-400000,-200000,0), labels=formatC(my.at,format="fg")) axis(2,at = my.at <- c(0,2*10^9,4*10^9,6*10^9), labels=formatC(my.at,format="fg")) points(-BP,10^(reg$coefficient[[1]]+reg$coefficient[[2]]*LBP),col="red",type="l")