Topic: CTFS Plot Maps
Topic Description:
Functions for maps of CTFS plot data. The file map.r has functions for tree distribution maps, including overlays of elevation contours. The file mapresponse.r has functions for creating color or contour maps of any numerical responses, based on the R functions image, contour, and filled.contour.
File: map/map.r
| View File Source | Download File | No help file available |
Function: map2species
Function Description: map2species
Map 2 species to a 2-panel pdf. Two species names are passed to spp as a vector. The data must be a list of two split plot data objects, spplist is a list of two different species tables, and elev a list of two different elevation matrices. To make 2 maps from the same plot, each of the lists should repeated the same data twice.Function Arguments:
| Argument | Default Value |
|---|---|
| spp | |
| data | list(bci3.spp,korup.spp) |
| spplist | list(plotspp$bci,plotspp$korup) |
| elev | list(ctfs.elev$bci,ctfs.elev$korup) |
| path | "spp" |
| export | |
| file | pst(spp[1],spp[2],"map.pdf") |
| ptsize | c(0.6 |
| 0.6) | |
| topo | c(2 |
| 4) | |
| ht | 11 |
| wd | 8.5 |
| plotside | 4 |
Function Source:
map2species=function(spp,data=list(bci3.spp,korup.spp),spplist=list(plotspp$bci,plotspp$korup),
elev=list(ctfs.elev$bci,ctfs.elev$korup),path="spp",
export=pdf,file=pst(spp[1],spp[2],"map.pdf"),ptsize=c(0.6,0.6),topo=c(2,4),
ht=11,wd=8.5,plotside=4)
{
if(!is.null(export))
{
on.exit(graphics.off())
export(height=ht,width=wd,file=pst(path,file))
}
else x11(height=ht,width=wd,xpos=725)
oldpar=par(mfcol=c(2,1),mai=c(1,.85,.1,.35),mgp=c(2,1,0),cex=1.4)
map(splitdatafile=data[[1]],species=spp[1],spplist=spplist[[1]],elevdata=elev[[1]]$mat,
export="file",size=rep(ptsize[1],3),topoint=topo[1],plotside=plotside,legpos=c(500,585))
map(splitdatafile=data[[2]],species=spp[2],spplist=spplist[[2]],elevdata=elev[[2]]$mat,
export="file",size=rep(ptsize[2],3),topoint=topo[2],plotside=plotside,legpos=c(500,585))
}
elev=list(ctfs.elev$bci,ctfs.elev$korup),path="spp",
export=pdf,file=pst(spp[1],spp[2],"map.pdf"),ptsize=c(0.6,0.6),topo=c(2,4),
ht=11,wd=8.5,plotside=4)
{
if(!is.null(export))
{
on.exit(graphics.off())
export(height=ht,width=wd,file=pst(path,file))
}
else x11(height=ht,width=wd,xpos=725)
oldpar=par(mfcol=c(2,1),mai=c(1,.85,.1,.35),mgp=c(2,1,0),cex=1.4)
map(splitdatafile=data[[1]],species=spp[1],spplist=spplist[[1]],elevdata=elev[[1]]$mat,
export="file",size=rep(ptsize[1],3),topoint=topo[1],plotside=plotside,legpos=c(500,585))
map(splitdatafile=data[[2]],species=spp[2],spplist=spplist[[2]],elevdata=elev[[2]]$mat,
export="file",size=rep(ptsize[2],3),topoint=topo[2],plotside=plotside,legpos=c(500,585))
}