attach('~/Desktop/bci.full.rdata') dir('~/Desktop') attach('~/Desktop/bcifull.rdata') attach('~/Desktop/BCIfull.rdata') ls(2) head(BCIfull) attach('~/Desktop/BCIdata.rdata') ls(2) head(BCIdata) dir() options(width=100) dir('/Desktop') dir('~/Desktop') options(width=125) dir('~/Desktop') getwd() setwd('~/Desktop') dir() attach('~/Datasets/bci.full6.rdata') search() ls(2) head(bci.full6) X=4 X x=1:10 x head(bci.full6) str(bci.full6) str(bci.full6) dim(bci.full6) bci.full6[1:5,1:6] subset(bci.full6,sp=='vochfe') options(width=110) subset(bci.full6,) head(bci.full6) dim(subset(bci.full6,sp=='vochfe')) dim(subset(bci.full6,sp=='faraoc')) table(bci.full6$sp) head(bci.full6) table(bci.full6$status) dim(subset(bci.full6,status=='A' & dbh>=10)) dim(subset(bci.full6,status=='A' & is.na(dbh))) dim(subset(bci.full6,status=='A' & dbh>=1000)) dim(subset(bci.full6,status=='A' & dbh>=2000)) head(bci.full6) plot(gy~gx,data=bci.full6,pch='.') plot(gy~gx,data=bci.full6) plot(gy~gx,data=bci.full6,pch='.') hist(bci.full6$dbh) hist(bci.full6$dbh,breaks=100) table(bci.full6$ExactDate) head(bci.full6) hist(bci.full6$date) tail(bci.full6) table(bci.full6$hom) table(bci.full6$pom) subset(bci.full6,hom>8)$dbh mean(subset(bci.full6,hom>8)$dbh) mean(subset(bci.full6,hom<1.2)$dbh) CTFSplot('bci',5) CTFSplot('bci',5,includespp=FALSE) dir() head(bci.full5) attach('bci.full5.rdata') search() ls(2) ls(3) ls(1) search() ls(3) dim(bci.full6) dim(bci.full5) tail(bci.full5) tail(bci.full6) plot(bci.full5$dbh,bci.full6$dbh) table(bci.full5$status) table(bci.full5$status,bci.full6$status) dir() attach('CTFSRPackage.rdata') search() ls(2) search() dir() attach('CTFSRPackage.rdata') search() ls(3) ls(2) detach(3) search() detach(5) search() detach(5) ls(16) ls(2) args(mortality) ?mortality ?mean args(mortality) args(mean) mean(x=bci.full5$agb) mean(bci.full5$agb) mortality(census1=bci.full5,census2=bci.full6) mort=mortality(census1=bci.full5,census2=bci.full6) mort mort$N is.data.frame(mort) is.list(mort) mort$rate names(mort) mort$upper mort$D/mort$N mort$N;mort$D big=bci.full5$dbh>=500 big=(bci.full5$dbh>=500) head(big) tail(big) table(big) head(big,200) table(big,exclude=NULL) big=(bci.full5$dbh>=500) mean(subset(bci.full5,big)$dbh) mean(subset(bci.full5,dbh>=500)$dbh) mean(subset(bci.full5,!big)$dbh) args(mortality) mort=mortality(census1=bci.full5,census2=bci.full6,split1=big) mort args(mortality) mort=mortality(census1=bci.full5,census2=bci.full6,split1=big) length(big) dim(bci.full5) mort big[bci.full5$dbh>=500]='large' big[bci.full5$dbh<500]='notsobig' mortality(census1=bci.full5,census2=bci.full6,split1=big) table(big) table(big,exclude=NULL) head(big,100) mortality(census1=bci.full5,census2=bci.full6,split1=big)$rate big[bci.full5$dbh>=500]='large' big[bci.full5$dbh<500]='notsobig' table(big,exclude=NULL) mortality(census1=bci.full5,census2=bci.full6,split1=big)$rate args(mortality.eachspp) length(big) west=character() west[bci.full5$gx<500] west[bci.full5$gx<500]='west' west=character() str(west) west[bci.full5$gx<500]='west' str(west) west[bci.full5$gx>=500]='east' table(west,exclude=NULL) half=character() half[bci.full5$gx<500]='west' half[bci.full5$gx>=500]='east' length(half) length(big) table(half,exclude=NULL) table(half,big,exclude=NULL) mortality(census1=bci.full5,census2=bci.full6,split1=big,split2=half)$rate mort=mortality(census1=bci.full5,census2=bci.full6,split1=big,split2=half) is.list(mort) is.data.frame(mort) names(mort) mort$N mort$D mort$rate mort$upper mort$lower savehistory('~/Desktop/RHistory22July2013.r')