# CTFS R-Format Tables

## R. Condit

### CTFS Plot Elevation

Most plots already have R Analytical Tables with plot elevation data stored in the table *Plotname*.elev.rdata.
These are available at the CTFS datasets page.
These data are in the format needed
by map programs, so that contour lines can be added to maps, and are in the format used by functions in the topography topic,
slope.r, for calculating slope and convexity of quadrats. Elevation data come in the R List format, and details are provided
below.

Column name | Description |
---|---|

col | In elevation data list, this is a data frame of elevation data, in columnar format |

x | In the columnar elevation data, this is x coordinate, matching gx of plot coordinate system in Tree and Stem tables, where called gx |

y | In the columnar elevation data, this is x coordinate, matching gy of plot coordinate system in Tree and Stem tables |

elev | Elevation in meters; in some plots, it is absolute elevation above-sea-level, but in other plots, relative elevation |

mat | In elevation data list, this is a matrix of elevation data in format needed by map, image, contour programs. The columns of the matrix are columns in the plot (x dimension), and rows of the matrix are rows in the plot (y dimension). Most plots have elevation recorded over a grid of 5x5 m, so the dimensions of the matrix [dim(elev$mat)] are 1+ydim/5, 1+xdim/5, with the 1 added because the elevation is recorded at all plot edges. Counterintuitively, image and contour functions of R require this matrix be transposed for the map to be right, ie, image(t(elev$mat)) works but image(elev$mat) is a faulty reflection of reality. |

xdim | The plot x dimension in meters, corresponding to plot and matrix columns |

ydim | The plot y dimension in meters, corresponding to plot and matrix rows |