pipeline.Rmd 4.92 KB
Newer Older

```{r, results="hide", echo=FALSE, warnings=FALSE}
opts_chunk$set(warnings = FALSE)

# FUNCTIONS FOR FORMATTING TABLES
pandify <- function(data.table){
	pandoc.table.return(data.table, styl="multiline", split.tables= 200, split.cells = 50, justify = "left")
}
```

\newpage

Georges Kunstler's avatar
Georges Kunstler committed
% Description of the traits and tree growth data formatting for workshop on traits and competitive interactions


# Introduction

This document describes the data structure and the main R functions available so far for the data formatting for the working group on traits and competition.

![Workflow](workflow.png "Workflow")

Georges Kunstler's avatar
Georges Kunstler committed

# Structure of data for analysis

For the analysis we need for each ecoregion country (or big tropical plot) a list with three elements.
Georges Kunstler's avatar
Georges Kunstler committed

## First element is a  data.frame for individual tree data with columns
Georges Kunstler's avatar
Georges Kunstler committed

```{r,results="asis",echo=FALSE}
	mytext <- pandify(read.csv("table.tree.csv", stringsAsFactors=FALSE))
	writeLines(mytext)
```

##  Second element is a data.frame competition index with columns
Georges Kunstler's avatar
Georges Kunstler committed

    - $tree.id$ a unique identifier of each tree
    - $ecocode$ the species code
    - one column per species with the name as in the species code $sp$ in the previous the plot code
	- $BATOT.COMPET$ the sum of the basal area of all species

## Third element is a data.frame for the species traits data with columns
Georges Kunstler's avatar
Georges Kunstler committed

```{r,results="asis",echo=FALSE}
	mytext <- pandify(read.csv("table.traits.csv", stringsAsFactors=FALSE))
	writeLines(mytext)
```
and the same columns with $sd$ instead of $mean$ with either the mean sd within species if species mean or the mean sd with genus if genus mean because no species data
a dummy variable with true or false if genus mean
Georges Kunstler's avatar
Georges Kunstler committed

# Competition index

## National forest inventory type data

We computes the sum of basal area (BA) per plot (including the weight of each tree to have a basal area in $m^2/ha$) total and per species without the  BA of the target tree (see the R function `BA.SP.FUN` in the file format.function.R).

## Large plot data

Need to compute the basal area ($m^2/ha$) per species in the neighborhood of each individuals in given radius $R$. The function  `BA.SP.FUN.XY` in the file format.function.R should do that but not tested.


# Traits data

The objective is to have a table with the species mean of the traits or the genus mean for the traits if no data available.

## TRY data

* The TRY data is provided with one row for each variables measured on a single individuals (traits variable and non traits variables). The function `fun.extract.try` (in FUN.TRY.R) extract the traits variables and the non traits variables that we want to create a table with one row per individual (Observation.ID) and one column per traits or non traits variables.

* Then we compute for each species (and all its potential synonyms) the mean observation of each traits (in log10) without experimental data if possible or with experimental data if no data. If no data is available for a given species we compute the *genus* mean (and a dummy variable indicating that this is genus mean). The function also compute the traits sd. See function `fun.species.traits` . This function also exclude outlier based on the method used by Kattge et al 2011 (GCB) (see function `fun.out.TF2`).

* Then I have computed the mean sd within species (assuming that the within species sd is constant over all species).

* So far on the French data I have only list species potential synonyms self build but it would be great to either creates a list of potential synonyms from existing list or alternatively to match the TRY species and the forest inventory species on the same list to have teh same species.



## Other data provided for each data

* Need to write a function to compute mean per species for each traits and decide if we use the same species sd for these data sets.

### Ecoregions

For the NFI data we will divide the data set by regions with similar ecological conditions. This will allow to estimate the link between competitive interactions and traits within regions of similar conditions and see how the results vary (for instance in the US there is a large variability between the north and the south). This will allow to make comparison with large tropical plot more easy. Then this will help to have smaller data set to speed up the estimation. Please could you either provides a source of ecoregion with a GIS layer that we can use or better directly includes this variable in the data (at the plot level). Similarly in term of climatic variables I was planning to use the best variables available for each data rather than a global data base of lower quality. Could you either give the link of such a data set or better directly do get the variables for each plot.
I think that we do not have any ecoregion information that was directly measured in the SFI data. However, we have joint each SFI plot with Olson ecoregions.


# Progress

```{r,results="asis",echo=FALSE}
	mytext <- pandify(read.csv("table.data.progress.csv", stringsAsFactors=FALSE))
	writeLines(mytext)
```