diff --git a/merge.data.FRANCE.R b/merge.data.FRANCE.R index 277893a41e237382a76e042af5627d3bdd6a43b0..3a935444cf156cc2afb2d219b47116139b66b801 100644 --- a/merge.data.FRANCE.R +++ b/merge.data.FRANCE.R @@ -1,11 +1,12 @@ ############################################# MERGE FRENCH DATA +rm(list = ls()); source("./R/format.function.R") +library(reshape) -################################ READ DATA (test) -dataIFN.FRANCE <- read.csv("./data/raw/DataFrance/dataIFN.FRANCE.csv", stringsAsFactors = FALSE) +################################ READ DATA +data.france <- read.csv("./data/raw/DataFrance/dataIFN.FRANCE.csv", stringsAsFactors = FALSE) ### read IFN species names and clean -species.clean <- fun.clean.species.tab(read.csv("./data/raw/DataFrance/species.csv", - sep = "\t", stringsAsFactors = FALSE)) +species.clean <- fun.clean.species.tab(read.csv("./data/raw/DataFrance/species.csv", stringsAsFactors = FALSE)) ### read TRY data data.TRY.sd.update <- readRDS("./data/process/data.TRY.sd.update.rds") @@ -16,23 +17,22 @@ merge.TRY <- merge(species.clean, data.frame.TRY, by = "Latin_name") rm(species.clean, data.frame.TRY) +###################################### MASSAGE TRAIT DATA Compute maximum height per species plus sd from observed +###################################### height to add variables to the traits data base Because we have two heights, +###################################### then take the max of the two heights and then bootstrap +res.quant.boot <- t(sapply(levels(factor(data.france[["espar"]])), FUN = f.quantile.boot, + R = 1000, x = log10(data.france[["htot"]]), fac = factor(data.france[["espar"]]))) - - -######################################################################## Compute maximum height per species plus sd from observed height in NFI data to -######################################################################## add variables to the traits data base -res.quant.boot <- t(sapply(levels(factor(dataIFN.FRANCE[["espar"]])), FUN = f.quantile.boot, - R = 1000, x = log10(dataIFN.FRANCE[["htot"]]), fac = factor(dataIFN.FRANCE[["espar"]]))) ## create data base data.max.height <- data.frame(code = rownames(res.quant.boot), Max.height.mean = res.quant.boot[, 1], Max.height.sd = res.quant.boot[, 2], Max.height.nobs = res.quant.boot[, 3]) rm(res.quant.boot) ## write.csv(data.max.height,file='./data/process/data.max.height.csv') -############## merge TRY with max height +## merge TRY with max height merge.TRY <- merge(merge.TRY, data.max.height, by = "code") rm(data.max.height) -# use mean sd of max tree height over all species +## use mean sd of max tree height over all species merge.TRY$Max.height.sd.1 <- rep(mean(merge.TRY[["Max.height.sd"]], na.rm = TRUE), length = nrow(merge.TRY)) @@ -42,103 +42,88 @@ names.traits.data <- c("code", "Latin_name", "Leaf.N.mean", "Seed.mass.mean", "S "Seed.mass.sd.1", "SLA.sd.1", "Wood.Density.sd.1", "Leaf.Lifespan.sd.1", "Max.height.sd.1") data.traits <- merge.TRY[, names.traits.data] -names(data.traits) <- c("sp", "Latin_name", "Leaf.N.mean", "Seed.mass.mean", "SLA.mean", - "Wood.Density.mean", "Leaf.Lifespan.mean", "Max.height.mean", "Leaf.N.sd", "Seed.mass.sd", - "SLA.sd", "Wood.Density.sd", "Leaf.Lifespan.sd", "Max.height.sd") ## rename to have standard variables name +names(data.traits) <- c("espar", "latin_name", "leafN.mean", "seedmass.mean", "SLA.mean", + "wooddensity.mean", "leaflifespan.mean", "maxheight.mean", "leafN.sd", "seedmass.sd", + "SLA.sd", "wooddensity.sd", "leaflifespan.sd", "maxheight.sd") rm(merge.TRY, names.traits.data) +########################################## FORMAT INDIVIDUAL TREE DATA change unit and names of variables to be the same +########################################## in all data for the tree +data.france$G <- data.france[["ir5"]]/5 * 2 ## diameter growth in mm per year +data.france$year <- rep(5, nrow(data.france)) ## number of year between measurement +data.france$D <- data.france[["c13"]]/pi ## diameter in cm +data.france$sp <- as.character(data.france[["espar"]]); data.france$espar <- NULL ## species code +data.france$plot.id <- (data.france[["idp"]]); data.france$idp <- NULL ## plot code +data.france$tree.id <- paste(data.france[["plot.id"]], data.france[["a"]], sep = "_") ## tree unique id +data.france$weights <- data.france[["w"]]/10000 +data.france$obs.id <- 1:nrow(data.france) ## There is only obs per tree.id, so this is superfluous - - -################################################################ FORMAT INDIVIDUAL TREE DATA - -## change unit and names of variables to be the same in all data for the tree -dataIFN.FRANCE$G <- dataIFN.FRANCE[["ir5"]]/5 * 2 ##diameter growth in mm per year -dataIFN.FRANCE$year <- rep(5, length(dataIFN.FRANCE[["ir5"]])) ## number of year between measurement -dataIFN.FRANCE$D <- dataIFN.FRANCE[["c13"]]/pi ## diameter in cm -dataIFN.FRANCE$dead <- dataIFN.FRANCE[["dead"]] ## dummy variable for dead tree 0 alive 1 dead -dataIFN.FRANCE$sp <- as.character(dataIFN.FRANCE[["espar"]]) ## species code -dataIFN.FRANCE$plot <- (dataIFN.FRANCE[["idp"]]) ## plot code -dataIFN.FRANCE$htot <- (dataIFN.FRANCE[["htot"]]) ## height of tree in m -dataIFN.FRANCE$tree.id <- paste(dataIFN.FRANCE[["idp"]], dataIFN.FRANCE[["a"]], sep = ".") ## tree unique id - - -#### change coordinates system of x y to be in lat long WGS84 +######################## change coordinates system of x y to be in lat long WGS84 library(sp) library(dismo) library(rgdal) -data.sp <- dataIFN.FRANCE[, c("idp", "xl93", "yl93")] +data.sp <- data.france[, c("idp", "xl93", "yl93")] coordinates(data.sp) <- c("xl93", "yl93") ## EPSG CODE 2154 proj4string(data.sp) <- CRS("+init=epsg:2154") # define projection system of our data ## EPSG CODE 2154 summary(data.sp) data.sp2 <- spTransform(data.sp, CRS("+init=epsg:4326")) ## change projection in WGS84 lat lon -dataIFN.FRANCE$Lon <- coordinates(data.sp2)[, "xl93"] -dataIFN.FRANCE$Lat <- coordinates(data.sp2)[, "yl93"] +data.france$Lon <- coordinates(data.sp2)[, "xl93"] +data.france$Lat <- coordinates(data.sp2)[, "yl93"] rm(data.sp, data.sp2) ## ## plot on world map library(rworldmap) newmap <- getMap(resolution = 'coarse') ## # different resolutions available plot(newmap) ## points(data.sp2,cex=0.2,col='red') -############################ merge greco to have no ecoregion with low number of observation +###################### ECOREGION - merge greco to have no ecoregion with low number of observation ## merge A and B Grand Ouest cristallin and oceanique and Center semi-oceanique ## merge G D E Vosges Jura massif cemtral (low mountain) merge H and I Alpes and ## Pyrenees Merge J and K Corse and Mediteraneen -dataIFN.FRANCE$GRECO <- substr(dataIFN.FRANCE[["SER"]], 1, 1) ## get GRECO from SER (smaller division by keeping only the first letter - -GRECO.temp <- dataIFN.FRANCE[["GRECO"]] +GRECO.temp <- substr(data.france[["SER"]], 1, 1) ## get GRECO from SER (smaller division by keeping only the first letter) GRECO.temp <- sub("[AB]", "AB", GRECO.temp) GRECO.temp <- sub("[GDE]", "GDE", GRECO.temp) GRECO.temp <- sub("[HI]", "HI", GRECO.temp) GRECO.temp <- sub("[JK]", "JK", GRECO.temp) -## plot(dataIFN.FRANCE[['xl93']],dataIFN.FRANCE[['yl93']],col=unclass(factor(GRECO.temp))) -## add NEW GRECO variable to data base -dataIFN.FRANCE$ecocode <- GRECO.temp ## a single code for each ecoregion - -## variable percent dead compute numer of dead per plot to remove plot with -## disturbance -perc.dead <- tapply(dataIFN.FRANCE[["dead"]], INDEX = dataIFN.FRANCE[["idp"]], FUN = function.perc.dead) -## VARIABLE TO SELECT PLOT WITH NOT BIG DISTURBANCE KEEP OFTHER VARIABLES IF -## AVAILABLE (disturbance record) -dataIFN.FRANCE <- merge(dataIFN.FRANCE, data.frame(idp = as.numeric(names(perc.dead)), +## plot(data.france[['xl93']],data.france[['yl93']],col=unclass(factor(GRECO.temp))) +data.france$ecocode <- GRECO.temp ## a single code for each ecoregion + + +###################### PERCENT DEAD variable percent dead/cannot do with since dead variable is +###################### missing compute numer of dead per plot to remove plot with disturbance +perc.dead <- tapply(data.france[["dead"]], INDEX = data.france[["plot.id"]], FUN = function.perc.dead2) + +data.france <- merge(data.france, data.frame(plot.id = as.numeric(names(perc.dead)), perc.dead = perc.dead), sort = FALSE) ########################################################################################### PLOT SELECTION FOR THE ANALYSIS -## dataIFN.FRANCE <- subset(dataIFN.FRANCE,subset= dataIFN.FRANCE[['YEAR']] != -## 2005)## year 2005 bad data according to IFN -dataIFN.FRANCE <- subset(dataIFN.FRANCE, subset = dataIFN.FRANCE[["plisi"]] == 0) # no plot on forest edge -dataIFN.FRANCE <- subset(dataIFN.FRANCE, subset = dataIFN.FRANCE[["dc"]] == 0) # no harvesting -dataIFN.FRANCE <- subset(dataIFN.FRANCE, subset = dataIFN.FRANCE[["tplant"]] == 0) # no plantation -dataIFN.FRANCE <- subset(dataIFN.FRANCE, subset = !is.na(dataIFN.FRANCE[["SER"]])) # missing SER - -#################################### SELECT GOOD COLUMNS +## data.france <- subset(data.france,subset= data.france[['YEAR']] != 2005) ## year 2005 bad data according to IFN +data.france <- subset(data.france, subset = data.france[["plisi"]] == 0) ## no plot on forest edge +data.france <- subset(data.france, subset = data.france[["dc"]] == 0) ## no harvesting +data.france <- subset(data.france, subset = data.france[["tplant"]] == 0) ## no plantation +data.france <- subset(data.france, subset = !is.na(data.france[["SER"]])) ## missing SER +## SELECT GOOD COLUMNS ## names of variables for abiotic conditions vec.abio.var.names <- c("MAT", "SAP", "sgdd", "WB.s", "WB.y", "WS.s", "WS.y") ## other var vec.basic.var <- c("tree.id", "sp", "plot", "ecocode", "D", "G", "dead", "year", "htot", "Lon", "Lat", "perc.dead") -data.tree <- subset(dataIFN.FRANCE, select = c(vec.basic.var, vec.abio.var.names)) - - - +data.tree <- subset(data.france, select = c(vec.basic.var, vec.abio.var.names)) +############################################## +#################### GENERATE ONE OBJECT PER ECOREGION - COMPUTE MATRIX OF COMPETITION INDEX WITH SUM OF BA PER SPECIES IN EACH PLOT in +#################### m^2/ha without the target species - - -################################################################################################################## COMPUTE MATRIX OF COMPETITION INDEX WITH SUM OF BA PER SPECIES IN EACH PLOT in -################################################################################################################## m^2/ha without the target species - -data.BA.SP <- BA.SP.FUN(id.tree = as.vector(dataIFN.FRANCE[["tree.id"]]), diam = as.vector(dataIFN.FRANCE[["D"]]), - sp = as.vector(dataIFN.FRANCE[["sp"]]), id.plot = as.vector(dataIFN.FRANCE[["idp"]]), - weights = as.vector(dataIFN.FRANCE[["w"]])/10000, weight.full.plot = 1/(pi * +data.BA.SP <- BA.SP.FUN(id.tree = as.vector(data.france[["tree.id"]]), diam = as.vector(data.france[["D"]]), + sp = as.vector(data.france[["sp"]]), id.plot = as.vector(data.france[["idp"]]), + weights = as.vector(data.france[["w"]])/10000, weight.full.plot = 1/(pi * (c(15))^2)) ## change NA and <0 data for 0 @@ -146,7 +131,7 @@ data.BA.SP[which(is.na(data.BA.SP), arr.ind = TRUE)] <- 0 data.BA.SP[, -1][which(data.BA.SP[, -1] < 0, arr.ind = TRUE)] <- 0 ### CHECK IF sp and sp name for column are the same -if (sum(!(names(data.BA.SP)[-1] %in% unique(dataIFN.FRANCE[["sp"]]))) > 0) stop("competition index sp name not the same as in data.tree") +if (sum(!(names(data.BA.SP)[-1] %in% unique(data.france[["sp"]]))) > 0) stop("competition index sp name not the same as in data.tree") #### compute BA tot for all competitors @@ -154,13 +139,12 @@ BATOT.COMPET <- apply(data.BA.SP[, -1], MARGIN = 1, FUN = sum, na.rm = TRUE) data.BA.SP$BATOT.COMPET <- BATOT.COMPET ### create data frame names(data.BA.SP) <- c("tree.id", names(data.BA.SP)[-1]) -data.BA.sp <- merge(data.frame(tree.id = dataIFN.FRANCE[["tree.id"]], ecocode = dataIFN.FRANCE[["ecocode"]]), +data.BA.sp <- merge(data.frame(tree.id = data.france[["tree.id"]], ecocode = data.france[["ecocode"]]), data.BA.SP, by = "tree.id", sort = FALSE) ## test if (sum(!data.BA.sp[["tree.id"]] == data.tree[["tree.id"]]) > 0) stop("competition index not in the same order than data.tree") - ## save everything as a list list.FRANCE <- list(data.tree = data.tree, data.BA.SP = data.BA.sp, data.traits = data.traits) save(list.FRANCE, file = "./data/process/list.FRANCE.Rdata") diff --git a/merge.data.SPAIN.R b/merge.data.SPAIN.R index 15eb6a94708f017bce4d67c014eb414b5045f83a..3ebf106a73995d89844880606e0b641fae830053 100644 --- a/merge.data.SPAIN.R +++ b/merge.data.SPAIN.R @@ -4,12 +4,10 @@ source("./R/format.function.R") source("./R/FUN.TRY.R") library(reshape) -######################### READ DATA read individuals tree data data.spain <- -######################### read.table('./data/raw/DataSpain/Tree_data_SFI.txt',header=TRUE,stringsAsFactors=FALSE,sep -######################### = '\t') +######################### READ DATA read individuals tree data data.spain <- read.table("./data/raw/DataSpain/Tree_data_SFI_aug13_alldata.txt", header = TRUE, stringsAsFactors = FALSE, sep = "\t") - + ###################################### MASSAGE TRAIT DATA Compute maximum height per species plus sd from observed ###################################### height to add variables to the traits data base Because we have two heights, ###################################### then take the max of the two heights and then bootstrap @@ -21,23 +19,25 @@ res.quant.boot <- t(sapply(levels(factor(data.spain[["SP_code"]])), FUN = f.quan data.max.height <- data.frame(code = rownames(res.quant.boot), Max.height.mean = res.quant.boot[, 1], Max.height.sd = res.quant.boot[, 2], Max.height.nobs = res.quant.boot[, 3], stringsAsFactors =FALSE) rm(res.quant.boot) -write.csv(data.max.height, file = "./data/process/data.max.height.spain.csv") # I was planning to save processed data in that folder +write.csv(data.max.height, file = "./data/process/data.max.height.spain.csv") ## I was planning to save processed data in that folder ################################################################ FORMAT INDIVIDUAL TREE DATA -## change unit and names of variables to be the same in all data for the tree -data.spain$G <- data.spain[["adbh"]] ## diameter growth in mm per year -data.spain$year <- data.spain[["years"]] ## number of year between measurement - MISSING +data.spain$G <- data.spain[["adbh"]] ## diameter growth in mm per year +data.spain$year <- data.spain[["years"]]; data.spain$years <- NULL; ## number of year between measurement data.spain$D <- data.spain[["dbh1"]]/10 ## diameter in mm convert to cm -data.spain$dead <- as.numeric(data.spain[["Life_status"]] == "dead") ## dummy variable for dead tree 0 alive 1 dead - MIGHT WANT TO CHANGE THIS TO BE BASED ON MORTALITY_CUT +data.spain$dead <- as.numeric(data.spain[["Life_status"]] == "dead") ## dummy variable for dead tree 0 alive 1 dead data.spain$sp <- paste("sp",(data.spain[["SP_code"]]) ,sep=".") ## species code -data.spain$sp.name <- data.spain[["SP_name"]] -data.spain$plot <- (data.spain[["Plot_ID_SFI"]]) ## plot code +data.spain$sp.name <- data.spain[["SP_name"]]; data.spain$SP_name <- NULL +data.spain$plot.id <- (data.spain[["Plot_ID_SFI"]]); data.spain$Plot_ID_SFI <- NULL ## plot code data.spain$htot <- data.spain[["ht1"]] ## height of tree in m -data.spain$tree.id <- data.spain$Tree_ID_SFI ## tree unique id -data.spain$obs.id <- as.character(1:nrow(data.spain)) ## obs uniquue id +data.spain$tree.id <- data.spain$Tree_ID_SFI; data.spain$Tree_ID_SFI <- NULL ## tree unique id +data.spain$obs.id <- as.character(1:nrow(data.spain)) ## obs uniquue id; could use tree unique id here since there is only one row per tree data.spain$census <- rep(1,nrow(data.spain)) ## only one census in spain data.spain$weights <- as.vector(1/(pi * (data.spain[["R1"]])^2)) ## weights in 1/m^2 + + +################# #### change coordinates system of x y to be in lat long WGS84 library(sp) library(dismo) @@ -60,73 +60,71 @@ rm(data.sp, data.sp2) ###################### ECOREGION merge greco to have no ecoregion with low number of observation greco <- read.csv(file = "./data/raw/DataSpain/R_Ecoregion.csv", header = T) greco <- greco[, c("Plot_ID_SFI", "BIOME", "eco_code")] -greco2 <- greco[!duplicated(greco$Plot), ] - +greco2 <- greco[!duplicated(greco$Plot), ]; +colnames(greco2) <- c("plot.id", "biome", "ecocode") rm(greco) -data.spain <- merge(data.spain, greco2, by = "Plot_ID_SFI") +data.spain <- merge(data.spain, greco2, by = "plot.id") rm(greco2) -table(data.spain$eco_code) -## There's an eco-region with no code, and one with < 1000 sites The former we -## could drop as they were on the border of Spain - -### PLOT ECOREGION -library(RColorBrewer) -mycols <- brewer.pal(10, "Set3") -ecoreg <- unclass(data.spain$eco_code) - -pdf("./figs/ecoregion.spain.pdf") -plot(data.spain[["CX"]][order(ecoreg)], data.spain[["CY"]][order(ecoreg)], pty = ".", - cex = 0.2, col = rep(mycols, as.vector(table(ecoreg)))) -legend("topleft", col = mycols, legend = levels(data.spain$eco_code), pch = rep(19, - length(levels(ecoreg))), cex = 2) -points(data.spain[["CX"]][ecoreg == 9], data.spain[["CY"]][ecoreg == 9], pty = ".", - cex = 0.5, col = "black") -## Highlight the 'rare' ecoregions -points(data.spain[["CX"]][ecoreg == 1], data.spain[["CY"]][ecoreg == 1], pty = ".", - cex = 0.5, col = "black") -## Highlight the 'rare' ecoregions PA1219 looks to be similar to PA1209, merge -## them together -dev.off() +table(data.spain$ecocode) +## There's an eco-region with no code, and one with < 1000 sites The former we could drop as they were on the border of Spain + +# ### PLOT ECOREGION +# library(RColorBrewer) +# mycols <- brewer.pal(10, "Set3") +# ecoreg <- unclass(data.spain$eco_code) +# +# pdf("./figs/ecoregion.spain.pdf") +# plot(data.spain[["CX"]][order(ecoreg)], data.spain[["CY"]][order(ecoreg)], pty = ".", +# cex = 0.2, col = rep(mycols, as.vector(table(ecoreg)))) +# legend("topleft", col = mycols, legend = levels(data.spain$eco_code), pch = rep(19, +# length(levels(ecoreg))), cex = 2) +# points(data.spain[["CX"]][ecoreg == 9], data.spain[["CY"]][ecoreg == 9], pty = ".", +# cex = 0.5, col = "black") +# ## Highlight the 'rare' ecoregions +# points(data.spain[["CX"]][ecoreg == 1], data.spain[["CY"]][ecoreg == 1], pty = ".", +# cex = 0.5, col = "black") +# ## Highlight the 'rare' ecoregions PA1219 looks to be similar to PA1209, merge +# ## them together +# dev.off() ## merge -data.spain$eco_codemerged <- combine_factor(data.spain$eco_code, c(1:8, 6, 9)) -data.spain <- data.spain[-which(data.spain$eco_codemerged == ""), ] - -##### -## PLOT of MERGED ECOREGION -## mycols <- brewer.pal(9, "Set3") -## plot(data.spain[["CX"]][order(data.spain$eco_codemerged)], data.spain[["CY"]][order(data.spain$eco_codemerged)], pty = ".", -## cex = 0.2, col = rep(mycols, as.vector(table(data.spain$eco_codemerged)))) -## legend("topleft", col = mycols, legend = levels(data.spain$eco_codemerged), pch = rep(19, -## length(levels(data.spain$eco_codemerged))), cex = 2) - -###################### PERCENT DEAD -###################### compute numer of dead per plot to remove plot with disturbance -perc.dead <- tapply(data.spain[["dead"]], INDEX = data.spain[["plot"]], FUN = function.perc.dead) +data.spain$ecocode.merged <- combine_factor(data.spain$ecocode, c(1:8, 6, 9)) +data.spain <- data.spain[-which(data.spain$ecocode.merged == ""), ] +data.spain$ecocode.merged <- as.character(factor(data.spain$ecocode.merged)) + +# PLOT of MERGED ECOREGION +# mycols <- brewer.pal(9, "Set3") +# plot(data.spain[["CX"]][order(data.spain$eco_codemerged)], data.spain[["CY"]][order(data.spain$eco_codemerged)], pty = ".", +# cex = 0.2, col = rep(mycols, as.vector(table(data.spain$eco_codemerged)))) +# legend("topleft", col = mycols, legend = levels(data.spain$eco_codemerged), pch = rep(19, +# length(levels(data.spain$eco_codemerged))), cex = 2) + +###################### PERCENT DEAD variable percent dead/cannot do with since dead variable is +###################### missing compute numer of dead per plot to remove plot with disturbance +perc.dead <- tapply(data.spain[["dead"]], INDEX = data.spain[["plot.id"]], FUN = function.perc.dead2) table(data.spain$dead) -## VARIABLE TO SELECT PLOT WITH NOT BIG DISTURBANCE KEEP OFTHER VARIABLES IF -## AVAILABLE (disturbance record) -data.spain <- merge(data.spain, data.frame(plot = as.numeric(names(perc.dead)), perc.dead = perc.dead, stringsAsFactors =FALSE), - sort = FALSE, by = "plot") +data.spain <- merge(data.spain, data.frame(plot.id = as.numeric(names(perc.dead)), perc.dead = perc.dead, stringsAsFactors =FALSE), + sort = FALSE, by = "plot.id") -########################################################### PLOT SELECTION FOR THE ANALYSIS Remove data with mortality == 1 or 2 +########################################################### PLOT SELECTION FOR THE ANALYSIS +## Remove data with mortality == 1 or 2 data.spain <- subset(data.spain, subset = (data.spain[["Mortality_Cut"]] == 0 | data.spain[["Mortality_Cut"]] == "")) colnames(data.spain)[colnames(data.spain) %in% c("mat", "pp", "PET")] <- c("MAT", "PP", "PET") -colnames(data.spain)[names(data.spain) == "eco_codemerged"] <- c("ecocode") +data.spain$ecocode <- NULL +colnames(data.spain)[names(data.spain) == "ecocode.merged"] <- c("ecocode") vec.abio.var.names <- c("MAT", "PP", "PET") -vec.basic.var <- c("tree.id","obs.id", "sp", "sp.name", "plot", "ecocode", "D", "G", "dead", +vec.basic.var <- c("tree.id","obs.id", "sp", "sp.name", "plot.id", "ecocode", "D", "G", "dead", "year", "htot", "Lon", "Lat", "perc.dead","census","weights") data.spain <- subset(data.spain, select = c(vec.basic.var, vec.abio.var.names)) - ############################################## ############################################## #################### GENERATE ONE OBJECT PER ECOREGION diff --git a/merge.data.SWEDEN.R b/merge.data.SWEDEN.R index d745a861c833b628f8698a7c59d66cb971e5509f..d83fcdcc5c77bfca8de4c2381c7b19c57029deb0 100644 --- a/merge.data.SWEDEN.R +++ b/merge.data.SWEDEN.R @@ -1,38 +1,64 @@ ### MERGE sweden DATA rm(list = ls()); source("./R/format.function.R"); library(reshape); -######################### -## READ DATA -#################### -### read individuals tree data +######################### READ DATA read individuals tree data #data.swe1 <- read.csv("./data/raw/DataSweden/Swe_NFI_1.csv",header=T,stringsAsFactors=F) #data.swe2 <- read.csv("./data/raw/DataSweden/Swe_NFI_2a.csv",header=T,stringsAsFactors=F) #data.swe3 <- read.csv("./data/raw/DataSweden/Swe_NFI_3.csv",header=T,stringsAsFactors=F) data.swe <- read.table("./data/raw/DataSweden/Swe_NFI_all.txt",header=T,stringsAsFactors=F,sep="\t") - -### Species names are in the xlsx files if required (we already have sp codes) - +head(data.swe) +data.swe$tree.id <- apply(cbind(data.swe[["TreeNr"]],data.swe[["TractNr"]],data.swe[["PlotNr"]],data.swe[["Year"]]),1,paste,collapse="_") +data.swe$plot.id <- apply(cbind(data.swe[["TractNr"]],data.swe[["PlotNr"]],data.swe[["Year"]]),1,paste,collapse="_") +#data.swe <- data.swe[order(data.swe$tree.id),] + +## Species names are in the xlsx files if required (we already have sp codes) +#dim(data.swe) +#table(table(data.swe$TreeID)) +#table(table(paste(data.swe$TractNr,data.swe$PlotNr,data.swe$TreeNr,data.swe$Year))) #data.swe <- rbind(data.swe1, data.swe2, data.swe3); #rm(data.swe1, data.swe2, data.swe3) -#data.swe$treeid <- apply(data.swe[,3:5],1,paste,collapse="_") -#data.swe$plotid <- apply(data.swe[,3:4],1,paste,collapse="_") -data.swe <- data.swe[order(data.swe$TreeID,data.swe$PlotInvent),] ## Shows the TreeID = "" first -sum(data.swe$TreeID == "") -dim(data.swe) - -### STOP HERE!!! - -###################################### -## MASSAGE TRAIT DATA -############################ -## Mean height in dataset - -########################################## -## FORMAT INDIVIDUAL TREE DATA -############# - -## change unit and names of variables to be the same in all data for the tree -data.swe$G <- 10*(data.swe$FinalDBH-data.swe$InitDBH)/data.swe$Interval ## diameter growth in mm per year +#data.swe <- data.swe[order(data.swe$TreeID,data.swe$PlotInvent),] ## Shows the TreeID = "" first +#data.swe <- data.swe[order(paste(data.swe$TractNr,data.swe$PlotNr,data.swe$TreeNr)),] ## Shows the TreeID = "" first + +## Format to desired form +data.swe$PlotInventID <- NULL; data.swe$TreeID <- NULL; +data.swe2 <- data.swe[rep(1:nrow(data.swe),each=2),] +data.swe2$dbh1 <- as.vector(rbind(data.swe$dia_t1,data.swe$dia_t2)) +data.swe2$dbh2 <- as.vector(rbind(data.swe$dia_t2,data.swe$dia_t3)) +data.swe2$dia_t1 <- data.swe2$dia_t2 <- data.swe2$dia_t3 <- NULL +data.swe2$vol1 <- as.vector(rbind(data.swe$vol_t1,data.swe$vol_t2)) +data.swe2$vol2 <- as.vector(rbind(data.swe$vol_t2,data.swe$vol_t3)) +data.swe2$vol_t1 <- data.swe2$vol_t2 <- data.swe2$vol_t3 <- NULL +data.swe2$dryw1 <- as.vector(rbind(data.swe$DryW_t1,data.swe$DryW_t2)) +data.swe2$dryw2 <- as.vector(rbind(data.swe$DryW_t2,data.swe$DryW_t3)) +data.swe2$DryW_t1 <- data.swe2$DryW_t2 <- data.swe2$DryW_t3 <- NULL + +data.swe2$Diameter <- data.swe2$Volume <- data.swe2$BrhAge <- NULL +data.swe <- data.swe2 +rm(data.swe2) + +###################################### MASSAGE TRAIT DATA Compute maximum height per species plus sd from observed +###################################### height to add variables to the traits data base Because we have two heights, +###################################### then take the max of the two heights and then bootstrap +## Obtain heights in dataset - I assume that they use the volume of a cylinder V = pi*r^2*h +data.swe$ht1 <- data.swe$vol1/(pi*(0.5*data.swe$dbh1/1000)^2) +data.swe$ht2 <- data.swe$vol2/(pi*(0.5*data.swe$dbh2/1000)^2) + +res.quant.boot <- t(sapply(levels(factor(data.swe[["TreeSpecies"]])), FUN = f.quantile.boot, + R = 1000, x = log10(apply(data.swe[, c("ht1", "ht2")], 1, max, na.rm = T)), + fac = factor(data.swe[["TreeSpecies"]]))) + +## create data base +data.max.height <- data.frame(code = rownames(res.quant.boot), Max.height.mean = res.quant.boot[, + 1], Max.height.sd = res.quant.boot[, 2], Max.height.nobs = res.quant.boot[, 3], stringsAsFactors =FALSE) +rm(res.quant.boot) +write.csv(data.max.height,file='./data/process/data.max.height.swe.csv') + +########################################## FORMAT INDIVIDUAL TREE DATA +## STOP HERE!!! +data.swe$obs.id <- 1:nrow(data.swe) +data.swe$census.id <- rep(1:2,nrow(data.swe)/2) ## Using first census in the row +data.swe$G <- 10*(data.swe$dbh2-data.swe$dbh1)/data.swe$Interval ## diameter growth in mm per year data.swe$G[which(data.swe$InitDBH == 0 | data.swe$FinalDBH == -999)] <- NA data.swe$year <- data.swe$Interval ## number of year between measuremen data.swe$D <- data.swe[["InitDBH"]]; data.swe$D[data.swe$D == 0] <- NA ;## diameter in cm diff --git a/merge.data.SWISS.R b/merge.data.SWISS.R index eb7ba34e585922074b14ae36c480002ad88bbb56..b7917253b31f8b6e4fdd675694cefab01b724bf4 100644 --- a/merge.data.SWISS.R +++ b/merge.data.SWISS.R @@ -61,8 +61,8 @@ data.max.height <- data.frame(code = rownames(res.quant.boot), Max.height.mean = rm(res.quant.boot) write.csv(data.max.height,file='./data/process/data.max.height.swiss.csv') -########################################## FORMAT INDIVIDUAL TREE DATA change unit and names of variables to be the same -########################################## in all data for the tree +########################################## FORMAT INDIVIDUAL TREE DATA + data.swiss$G <- 10 * (data.swiss$dbh_diff)/data.swiss$year ## diameter growth in mm per year data.swiss$D <- data.swiss[["dbh1"]] data.swiss$D[data.swiss$D == 0] <- NA ## diameter in cm @@ -80,8 +80,6 @@ data.swiss$ecocode <- rep("A", nrow(data.swiss)) ###################### PERCENT DEAD variable percent dead/cannot do with since dead variable is ###################### missing compute numer of dead per plot to remove plot with disturbance perc.dead <- tapply(data.swiss[["dead"]], INDEX = data.swiss[["plot"]], FUN = function.perc.dead2) -# ## VARIABLE TO SELECT PLOT WITH NOT BIG DISTURBANCE KEEP OTHER VARIABLES IF -# AVAILABLE (disturbance record) data.swiss <- merge(data.swiss, data.frame(plot = names(perc.dead), perc.dead = perc.dead, stringsAsFactors =FALSE), by = "plot", sort = FALSE) @@ -94,7 +92,6 @@ data.swiss <- merge(data.swiss, data.frame(siteid = data.climate$CLNR, swb = dat MAT = data.climate$tave_68, MAP = data.climate$MAP, stringsAsFactors =FALSE), sort = F, all.x = T) rm(data.climate) -############################################## ############################################## #################### GENERATE ONE OBJECT PER ECOREGION # vector of ecoregion name diff --git a/ms/cleanCSV.sh b/ms/cleanCSV.sh new file mode 100644 index 0000000000000000000000000000000000000000..32b0fc251975ade0153199923f04c01e4187425f --- /dev/null +++ b/ms/cleanCSV.sh @@ -0,0 +1,2 @@ +# Removes bad files endings on csv data from saving with Microsoft Excel in mac +find . -name '*.csv' | xargs perl -pi -e 's/\r/\n/g' diff --git a/ms/create_folders.R b/ms/create_folders.R index af2ec0c5d65ad7e8d56de7bbf18b75f2fbc6e1cb..269a641c4c01280b27062650af0d0b0fda8d9529 100644 --- a/ms/create_folders.R +++ b/ms/create_folders.R @@ -45,3 +45,19 @@ for(i in 1:length(details[,1]) ) l[[details[i,1]]]<- details[i,2] +# Generate tables for each file +f <- "new.JSON" +cat("", file = f) + +for(d in dir("metadata", full.names = TRUE) ){ + cat(paste(d, "\n\n\tfiles: "), file = f, append = TRUE) + x<-read.csv(file.path(d,"_file_index.csv"), stringsAsFactors=FALSE) + l <- list() + for(i in 1:length(x[,1]) ) + l[[x[i,1]]]<- as.list(x[1,2:4]) + cat(toJSON(l), file = f, append = TRUE) + } + + + + diff --git a/ms/requirements/data.format.md b/ms/data.format.md similarity index 100% rename from ms/requirements/data.format.md rename to ms/data.format.md diff --git a/ms/metadata/BCI/_file_index.csv b/ms/metadata/BCI/_file_index.csv deleted file mode 100644 index d33faadbc75192ccdabc986b1719bbc1e39d46a5..0000000000000000000000000000000000000000 --- a/ms/metadata/BCI/_file_index.csv +++ /dev/null @@ -1,4 +0,0 @@ -filename,sep,skip,contents -BCITRAITS_20101220.csv,c,0,"Trait data for BCI species, collected by Joe Wright and others. Available " -census1/PlotsDataReport.txt,t,0,"Data from a single census. There is a similar file for each census. Downlaoded from https://ctfs.arnarb.harvard.edu/webatlas/datasets/bci/" -TaxonomyDataReport.txt,t,0,"Species codes, names, families, provided by Joe Wright" diff --git a/ms/metadata/BCI/_site_details.JSON b/ms/metadata/BCI/_site_details.JSON index 889b10d90b38be092dd8cdb2cdf4a5a565bef0d8..58b4308eb64d8792d4aa300983725a23aa0d499b 100644 --- a/ms/metadata/BCI/_site_details.JSON +++ b/ms/metadata/BCI/_site_details.JSON @@ -4,7 +4,8 @@ "email": "wrightj@si.edu", "affiliation": "Centre for Tropical Science" }, - "dataset": { + "agreement": "Census data obtained via data request from at https://ctfs.arnarb.harvard.edu/webatlas/datasets/bci/ under following agreement:\n\n * do not share the BCI data with other parties not included on the Request for Data Access Proposal.\n * Publications using BCI data should include the following citations:\n\t - Hubbell, S.P., Condit, R., and Foster, R.B. 2005. Barro Colorado Forest Census Plot Data. URL https://ctfs.arnarb.harvard.edu/webatlas/datasets/bci.\n\t - Condit, R. 1998. Tropical Forest Census Plots. Springer-Verlag and R. G. Landes Company, Berlin, Germany, and Georgetown, Texas. - Hubbell, S.P., R.B. Foster, S.T. O'Brien, K.E. Harms, R. Condit, B. Wechsler, S.J. Wright, and S. Loo de Lao. 1999. Light gap disturbances, recruitment limitation, and tree diversity in a neotropical forest. Science 283: 554-557. \n * Copies of articles should be sent to the BCI PIs prior to submission. Unless stated otherwise, the PIs will not be involved as collaborators, but reserve the right to request authorship. Once published, any manuscript making use of the BCI data should be sent to the PIs. \n * Publications should also include an acknowledgement of the support of the Center for Tropical Forest Science of the Smithsonian Tropical Research Institute and the primary granting agencies that have supported the BCI plot: *'The BCI forest dynamics research project was made possible by National Science Foundation grants to Stephen P. Hubbell: DEB-0640386, DEB-0425651, DEB-0346488, DEB-0129874, DEB-00753102, DEB-9909347, DEB-9615226, DEB-9615226, DEB-9405933, DEB-9221033, DEB-9100058, DEB-8906869, DEB-8605042, DEB-8206992, DEB-7922197, support from the Center for Tropical Forest Science, the Smithsonian Tropical Research Institute, the John D. and Catherine T. MacArthur Foundation, the Mellon Foundation, the Small World Institute Fund, and numerous private individuals, and through the hard work of over 100 people from 10 countries over the past two decades. The plot project is part the Center for Tropical Forest Science, a global network of large-scale demographic tree plots.'*\n\n Trait data supplied by Joe Wright under following agreement ????", + "dataset":{ "name": "Barro colorado island, 50 ha plot", "country": "Panama", "climate": "Tropical", @@ -21,5 +22,16 @@ "Condit, R. 1998. Tropical Forest Census Plots. Springer-Verlag and R. G. Landes Company, Berlin, Germany, and Georgetown, Texas.", "Hubbell, S.P. and R.B. Foster. (1992) 'Short-Term Dynamics of a Neotropical Forest: Why Ecological Research Matters to Tropical Conservation and Management.' Oikos 63: 48–61. doi:10.2307/3545515", "Wright, S.J., K. Kitajima, N.J.B. Kraft, P.B. Reich, I.J. Wright, D.E. Bunker, R. Condit, et al. “Functional Traits and the Growth–mortality Trade-off in Tropical Trees.' Ecology 91: 3664–3674. doi:10.1890/09-2335.1" - ] - } + ], + "files":{ + "BCITRAITS_20101220.csv":{ + "sep":"c", + "contents":"Trait data for BCI species, collected by Joe Wright and others."}, + "census1/PlotsDataReport.txt":{ + "sep":"c", + "contents":"Data from a single census. There is a similar file for each census."}, + "TaxonomyDataReport.txt":{ + "sep":"c", + "contents":"Species codes, names, families, provided by Joe Wright"} + } +} diff --git a/ms/metadata/BCI/files/BCITRAITS_20101220.csv b/ms/metadata/BCI/files/BCITRAITS_20101220.csv index 0ed5e69865c0a3557319340ec50f1fda2a0e470a..fd3ba25d633a97d2f569a9529320e4d085f0d2d2 100644 --- a/ms/metadata/BCI/files/BCITRAITS_20101220.csv +++ b/ms/metadata/BCI/files/BCITRAITS_20101220.csv @@ -1 +1,22 @@ -use,var,units,description 1,GENUS,,genus name truncated at 12 letters 1,SPECIES,,species name truncated at 12 letters 1,FAMILY,,family name truncated at 12 letters 1,GRWFRM2,,Values are as in GRWFRM1 except free-standing species can have multiple values if maximum size varies widely within Panama 1,GRWFRM1,,"Values are Climber, HERB, S, U, M and T. S, U, M and T are free-standing species with maximum heights of 5, 10, 20 and > 30 m, respectively. " 1,SP,,six letter species code 1,SG60C_AVG,g/cm3,mean wood specific gravity after drying at 60C 1,SG100C_AVG,g/cm3,mean wood specific gravity after drying at 100C 1,SG60C_SEM,g/cm3,standard error of SG60C_AVG 1,SG100C_SEM,g/cm3,standard error of SG100C_AVG 1,SG60C_N,,number of individuals sampled for SG60C_AVG 1,SG100C_N,,number of individuals sampled for SG100C_AVG 1,SEED_DRY,g,"mean seed dry mass after drying at 60C, where seed is defined to include the endosperm and embryo only" 1,DBH_AVG,mm,mean DBH measured in 2005 of up to the six largest individuals in the BCI 50-ha plot 1,HEIGHT_AVG,m,mean height of up to the six largest individuals in the BCI 50-ha plot 1,DIAM_AVG,m,mean crown diameter of up to the six largest individuals in the BCI 50-ha plot 1,DBH_SEM,mm,one standard error of DBH_AVG 1,HEIGHT_SEM,m,one standard error of HEIGHT_AVG 1,DIAM_SEM,m,one standard error of DIAM_AVG 1,LMALAM_AVD,g/m2,mean leaf mass per unit area measured for the leaf lamina excluding the petiole and for compound leaves the petiolules for leaves receiving direct sunlight 1,LMALAM_SED,g/m2,one standard error for LMALAM_AVD \ No newline at end of file +use,var,units,description +1,GENUS,,genus name truncated at 12 letters +1,SPECIES,,species name truncated at 12 letters +1,FAMILY,,family name truncated at 12 letters +1,GRWFRM2,,Values are as in GRWFRM1 except free-standing species can have multiple values if maximum size varies widely within Panama +1,GRWFRM1,,"Values are Climber, HERB, S, U, M and T. S, U, M and T are free-standing species with maximum heights of 5, 10, 20 and > 30 m, respectively. " +1,SP,,six letter species code +1,SG60C_AVG,g/cm3,mean wood specific gravity after drying at 60C +1,SG100C_AVG,g/cm3,mean wood specific gravity after drying at 100C +1,SG60C_SEM,g/cm3,standard error of SG60C_AVG +1,SG100C_SEM,g/cm3,standard error of SG100C_AVG +1,SG60C_N,,number of individuals sampled for SG60C_AVG +1,SG100C_N,,number of individuals sampled for SG100C_AVG +1,SEED_DRY,g,"mean seed dry mass after drying at 60C, where seed is defined to include the endosperm and embryo only" +1,DBH_AVG,mm,mean DBH measured in 2005 of up to the six largest individuals in the BCI 50-ha plot +1,HEIGHT_AVG,m,mean height of up to the six largest individuals in the BCI 50-ha plot +1,DIAM_AVG,m,mean crown diameter of up to the six largest individuals in the BCI 50-ha plot +1,DBH_SEM,mm,one standard error of DBH_AVG +1,HEIGHT_SEM,m,one standard error of HEIGHT_AVG +1,DIAM_SEM,m,one standard error of DIAM_AVG +1,LMALAM_AVD,g/m2,mean leaf mass per unit area measured for the leaf lamina excluding the petiole and for compound leaves the petiolules for leaves receiving direct sunlight +1,LMALAM_SED,g/m2,one standard error for LMALAM_AVD diff --git a/ms/metadata/BCI/files/census1_PlotsDataReport.csv b/ms/metadata/BCI/files/census1_PlotsDataReport.csv index 87452e7ebad7a6db95d82dd9a7400f25d854bf31..43cb88cb13277c9e959f5195fd9e09b941f93b1a 100644 --- a/ms/metadata/BCI/files/census1_PlotsDataReport.csv +++ b/ms/metadata/BCI/files/census1_PlotsDataReport.csv @@ -1 +1,17 @@ -use,var,units,description 0,Plot,, 0,Latin,, 0,Quadrat,,Quadrat designation. 0,gx,,The x coordinate within the plot relative to one edge of the plot. 0,gy,,The y plot coordinate. 0,TreeID,,The unique tree identifier in CTFS database. Useful to be certain in matching trees. 0,Tag,,Tag number used in the field. 0,StemID,,The unique stem identifier in CTFS database. Useful to be certain in matching stems. 0,StemTag,,Tag number on the individual stem 0,Census,,The numeric identifier of the census. 0,DBH,,Diameter of one stem on the tree the stem whose stemID is given. 0,HOM,,The height-of-measure 0,Date,,The date on which a tree was measured. 0,Codes,,The codes for the measurement as recorded in the field. 0,Stem,,The number of living stems on the date of measurement. 0,Status,,"An abbreviated version of status, for compatibility with earlier versions of functions in the CTSF R package: A, D, M, P" \ No newline at end of file +use,var,units,description +0,Plot,, +0,Latin,, +0,Quadrat,,Quadrat designation. +0,gx,,The x coordinate within the plot relative to one edge of the plot. +0,gy,,The y plot coordinate. +0,TreeID,,The unique tree identifier in CTFS database. Useful to be certain in matching trees. +0,Tag,,Tag number used in the field. +0,StemID,,The unique stem identifier in CTFS database. Useful to be certain in matching stems. +0,StemTag,,Tag number on the individual stem +0,Census,,The numeric identifier of the census. +0,DBH,,Diameter of one stem on the tree the stem whose stemID is given. +0,HOM,,The height-of-measure +0,Date,,The date on which a tree was measured. +0,Codes,,The codes for the measurement as recorded in the field. +0,Stem,,The number of living stems on the date of measurement. +0,Status,,"An abbreviated version of status, for compatibility with earlier versions of functions in the CTSF R package: A, D, M, P" \ No newline at end of file diff --git a/ms/metadata/Canada/_file_index.csv b/ms/metadata/Canada/_file_index.csv deleted file mode 100644 index 111ba8a28a95840532c3c7cacada388be3f88c9e..0000000000000000000000000000000000000000 --- a/ms/metadata/Canada/_file_index.csv +++ /dev/null @@ -1,4 +0,0 @@ -filename,sep,skip,contents -Canada_Data2George_20130818.csv,c,0, -EcoregionCodes.csv,c,0, -FIA_REF_SPECIES.csv,c,0, diff --git a/ms/metadata/Canada/_site_details.JSON b/ms/metadata/Canada/_site_details.JSON index 55d8ee99cb5a24b7a35ef49d52e0301b744a0b15..4d7bcfe13fea528b9327b25435f46e4dfa1da910 100644 --- a/ms/metadata/Canada/_site_details.JSON +++ b/ms/metadata/Canada/_site_details.JSON @@ -4,20 +4,30 @@ "email": "john.caspersen@utoronto.ca", "affiliation": "Faculty of Forestry, University of Toronto, Canada" }, + "agreement": "", "dataset": { - "name": "", + "name": "Candaian National Forest Inventory Dataset", "country": "Canada", "climate": "", "vegetation type": "", "latitude": -1, "longitude": -1, - "minimum tree size": "variable (from ? to ?", + "minimum tree size": "variable (from ? to ?)", "history": "", "field methodology": "", "trait information": "" }, - "references": [ - "", - "" - ] + "references": ["", + ""], + "files":{ + "Canada_Data2George_20130818.csv":{ + "sep":"c", + "contents":"NA"}, + "EcoregionCodes.csv":{ + "sep":"c", + "contents":"NA"}, + "FIA_REF_SPECIES.csv":{ + "sep":"c", + "contents":"NA"} + } } diff --git a/ms/metadata/Canada/files/Canada_Data2George_20130818.csv b/ms/metadata/Canada/files/Canada_Data2George_20130818.csv index c8cb3c7f87fc649f1d0352ef5ae7130550f0b804..583f7f5fbec539e455565306317b97b5782dfa96 100644 --- a/ms/metadata/Canada/files/Canada_Data2George_20130818.csv +++ b/ms/metadata/Canada/files/Canada_Data2George_20130818.csv @@ -1,16 +1,16 @@ use,var,units,description -0,PLOTTREE_I,, -0,Species_FIAcode,, -0,InitDBH,, -0,FinalDBH,, -0,PLOT_ID,, -0,Subplot_ID,, -0,SubPlot_Size,, -0,Lat,, -0,Lon,, -0,IndWeight,, -0,IntervalYears,, -0,Ecocode,, -0,MAT,, -0,MAP,, -0,Province,, +0,PLOTTREE_I,,A tree identifier field. +0,Species_FIAcode,,The species names can be looked up from a separate file (Canadian_species.csv) +0,InitDBH,,"DBH at the first measurement, in cm. Set to 0 if the tree was not included in the first measurement." +0,FinalDBH,,"DBH at the second measurement, in cm. Set to -999 if the tree was dead at the second measurement." +0,PLOT_ID,,A plot identifier field. +0,Subplot_ID,,"Subplot identifier. Each plot consists of up to four subplots. I've removed all subplots that were harvested between measurements, that crossed a stand boundary, or that had no trees." +0,SubPlot_Size,,"This is the total area, in ha, of all the subplots included in each tree's plot. The size of each subplot depends on the DBH of the tree that was recorded." +0,Lat,,"Plot latitude, in decimal degrees." +0,Lon,,"Plot longitude, in decimal degrees." +0,IndWeight,,This is the weighting (#/ha) assigned to each tree for calculating plot basal area. It is just 1/PlotSize. +0,IntervalYears,,"The duration of the interval between measurements, in years." +0,Ecocode,,"The code corresponding to this plot's ecoregion. The names can be looked up from a separate file (EcoregionCodes.csv). There is a 3-level hierarchy of ecoregions (domain, division, province). It may be worth aggregating ecoregions to the division level to reduce the number of separate units." +0,MAT,,"Mean annual temperature from 1961-1990 for this plot's location, from the WorldClim database." +0,MAP,,"Mean annual precipitation from 1961-1990 for this plot's location, from the WorldClim database." +0,Province,,Based on WorldClim climate data for now. If we are using WorldClim for the Canadian data too then we use the same data to maintain consistency. \ No newline at end of file diff --git a/ms/metadata/France/_file_index.csv b/ms/metadata/France/_file_index.csv deleted file mode 100644 index 5c53d263ef4af1f1a0d0a4b14ae29644fcdfdf4b..0000000000000000000000000000000000000000 --- a/ms/metadata/France/_file_index.csv +++ /dev/null @@ -1,3 +0,0 @@ -filename,sep,skip,contents -dataIFN.FRANCE.csv,c,0,data for IFN France with climatic variables -species.csv,c,0,species code and species Latin name diff --git a/ms/metadata/France/_site_details.JSON b/ms/metadata/France/_site_details.JSON index ffa8cafb21c2acca65b55dcf2e2a593758445b08..5e94ffe9d7c648023932cf108402cb1e2601f9ed 100644 --- a/ms/metadata/France/_site_details.JSON +++ b/ms/metadata/France/_site_details.JSON @@ -4,11 +4,11 @@ "email": "georges.kunstler@gmail.com", "affiliation": "Irstea, UR Mountain Ecosystems, St-Martin-d'H?res, France & Department of Biological Sciences, Macquarie University, Sydney, NSW 2109, Australia" }, + "agreement": "", "dataset": { "name": "French National Forest Inventory", "country": "France", - "climate": "The climate of the lowlands varies from Mediterranean through oceanic to continental -vegetation type Mediterranean, temperate and mountain forests", + "climate": "The climate of the lowlands varies from Mediterranean through oceanic to continental vegetation type Mediterranean, temperate and mountain forests", "vegetation type": "Mediterranean, temperate and mountain forests", "latitude": "NA", "longitude": "NA", @@ -20,8 +20,14 @@ vegetation type Mediterranean, temperate and mountain forests", "trait information": "extracted from the TRY database (http://try-db.org/)" }, - "references": [ - "http://inventaire-forestier.ign.fr/spip/", - "Kunstler, G., S. Lavergne, B. Courbaud, W. Thuiller, G. Vieilledent, N.E. Zimmermann, J. Kattge, and D.A. Coomes. Competitive Interactions Between Forest Trees Are Driven by Species’ Trait Hierarchy, Not Phylogenetic or Functional Similarity: Implications for Forest Community Assembly. Ecology Letters 15: 831–840. doi:10.1111/j.1461-0248.2012.01803.x" - ] - } + "references": ["http://inventaire-forestier.ign.fr/spip/", + "Kunstler, G., S. Lavergne, B. Courbaud, W. Thuiller, G. Vieilledent, N.E. Zimmermann, J. Kattge, and D.A. Coomes. Competitive Interactions Between Forest Trees Are Driven by Species’ Trait Hierarchy, Not Phylogenetic or Functional Similarity: Implications for Forest Community Assembly. Ecology Letters 15: 831–840. doi:10.1111/j.1461-0248.2012.01803.x"], + "files":{ + "dataIFN.FRANCE.csv":{ + "sep":"c", + "contents":"data for IFN France with climatic variables"}, + "species.csv":{ + "sep":"c", + "contents":"species code and species Latin name"} + } +} diff --git a/ms/metadata/Fushan/_file_index.csv b/ms/metadata/Fushan/_file_index.csv deleted file mode 100644 index 2793286812244490c77a3d192ad7ec168f2a99bd..0000000000000000000000000000000000000000 --- a/ms/metadata/Fushan/_file_index.csv +++ /dev/null @@ -1,3 +0,0 @@ -filename,sep,skip,contents -fs_trait_Kunstler.txt,t,0, -Splist_Fushan_En.csv,c,0, diff --git a/ms/metadata/Fushan/_site_details.JSON b/ms/metadata/Fushan/_site_details.JSON index 9451d5a65f153a1d2829c47b5333582ce2d224d5..c108907ff5280c49c8a7d2fd5573ab32defce59d 100644 --- a/ms/metadata/Fushan/_site_details.JSON +++ b/ms/metadata/Fushan/_site_details.JSON @@ -4,6 +4,7 @@ "email": "ifsun@mail.ndhu.edu.tw", "affiliation": "Department of Natural Resources and Environmental Studies, National Dong Hwa University, Hualien 974, Taiwan" }, + "agreement": "", "dataset": { "name": "Fushan", "country": "Taiwan", @@ -16,9 +17,14 @@ "field methodology": "", "trait information": "" }, - "references": [ - "Lasky, J.R., Sun, I., Su, S.-H., Chen, Z.-S., and Keitt, T.H. (2013). Trait-mediated effects of environmental filtering on tree community dynamics. Journal of Ecology. -", - "" - ] + "references": ["Lasky, J.R., Sun, I., Su, S.-H., Chen, Z.-S., and Keitt, T.H. (2013). Trait-mediated effects of environmental filtering on tree community dynamics. Journal of Ecology.", + ""], + "files":{ + "fs_trait_Kunstler.txt":{ + "sep":"t", + "contents":"NA"}, + "Splist_Fushan_En.csv":{ + "sep":"t", + "contents":"NA" } + } } diff --git a/ms/metadata/NSW/_file_index.csv b/ms/metadata/NSW/_file_index.csv deleted file mode 100644 index 559573d062ba3766536e372a7f251dcaab618718..0000000000000000000000000000000000000000 --- a/ms/metadata/NSW/_file_index.csv +++ /dev/null @@ -1,7 +0,0 @@ -filename,sep,skip,contents -NSW_data_BRcontrols.csv,c,0, -NSW_data_BRtreatments.csv,t,0, -NSW_data_BS1.csv,t,0, -NSW_data_BS2.csv,t,0, -NSW_data_TND.csv,t,0, -NSW_traits.csv,c,0, diff --git a/ms/metadata/NSW/_site_details.JSON b/ms/metadata/NSW/_site_details.JSON index f1848acea855060eb431f31fa7fa3781abf61def..63f5466b165480c024587825aa501cfbe2bf62e7 100644 --- a/ms/metadata/NSW/_site_details.JSON +++ b/ms/metadata/NSW/_site_details.JSON @@ -4,6 +4,7 @@ "email": "robert@ecodingo.com.au", "affiliation": "National Herbarium of NSW, Royal Botanic Gardens and Domain Trust, Sydney, Australia" }, + "agreement": "", "dataset": { "name": "NSW", "country": "Australia", @@ -16,8 +17,26 @@ "field methodology": "", "trait information": "" }, - "references": [ - "", - "" - ] + "references": ["", + ""], + "files":{ + "NSW_data_BRcontrols.csv":{ + "sep":"c", + "contents":""}, + "NSW_data_BRtreatments.csv":{ + "sep":"c", + "contents":""}, + "NSW_data_BS1.csv":{ + "sep":"c", + "contents":""}, + "NSW_data_BS2.csv":{ + "sep":"c", + "contents":""}, + "NSW_data_TND.csv":{ + "sep":"c", + "contents":""}, + "NSW_traits.csv":{ + "sep":"c", + "contents":""} + } } diff --git a/ms/metadata/NSW/files/NSW_data_BRcontrols.csv b/ms/metadata/NSW/files/NSW_data_BRcontrols.csv index 950f27e1b207daeb3a57120719eff012a1b1b75d..3561029e9965f10bc55696a02646f8922848b273 100644 --- a/ms/metadata/NSW/files/NSW_data_BRcontrols.csv +++ b/ms/metadata/NSW/files/NSW_data_BRcontrols.csv @@ -1,2 +1,10 @@ use,var,units,description -0,Plot.Tree.No.species..Growth.status.Ecol..Status.Date.of.measure.Dbh..x.y,, +1,Plot,, +1,Tree.No,, +1,species,, +1,Growth.status,, +1,Ecol..Status,, +1,Date.of.measure,, +1,Dbh,, +1,x,, +1,y,, \ No newline at end of file diff --git a/ms/metadata/NVS/_file_index.csv b/ms/metadata/NVS/_file_index.csv deleted file mode 100644 index 2296497fab24f63ace24422dc5cbbeaa9ed38107..0000000000000000000000000000000000000000 --- a/ms/metadata/NVS/_file_index.csv +++ /dev/null @@ -1,4 +0,0 @@ -filename,sep,skip,contents -nz_plotinfo_130801.csv,c,0, -nz_traits_130801.csv,c,0, -nz_treedata_growth_130801.csv,c,0, diff --git a/ms/metadata/NVS/_site_details.JSON b/ms/metadata/NVS/_site_details.JSON index 72dfaabdfd421b080d86659a19b4300d6da9329e..62b809f3f9b1386047dc1ecc62f4e0cc06830af2 100644 --- a/ms/metadata/NVS/_site_details.JSON +++ b/ms/metadata/NVS/_site_details.JSON @@ -4,6 +4,7 @@ "email": "d.laughlin@waikato.ac.nz", "affiliation": "Plant Ecology, University of Waikato" }, + "agreement": "Data use agreement between Georges Kunstler and Daniel Laughlin/Sarah Richardson. \n\n A data use agreement is a formality to clarify expectations around data use for a specific purpose. In this instance it covers the supply of plant trait data to Georges Kunstler from Daniel Laughlin and Sarah Richardson. \n The specific purpose is a workshop organised by Georges Kunstler, Mark Westoby and Daniel Falster, and resulting publications. The workshop will test whether plant traits predict tree competition and will be held in Sydney in September 2013. The analysis will be undertaken by Georges prior to the workshop and by Daniel while at the workshop. The need for a data use agreement arises because the cost of collecting and managing primary data has to be recouped by individual researchers and their institutes through the publication of research articles. To ensure a rewarding collaboration for all parties, we suggest the following conditions for the use of plant trait data for this workshop and analysis: \n\n 1. These data can only be used for the purposes of this workshop and analysis. \n 2. The raw data may only be used by Georges Kunstler, and his co-worker involved in the project, and will not be shared among other researchers at the workshop or any other third party without written permission. \n3. The raw data will not be published.", "dataset": { "name": "NVS", "country": "New Zealand", @@ -16,8 +17,16 @@ "field methodology": "", "trait information": "" }, - "references": [ - "", - "" - ] + "references": ["",""], + "files":{ + "nz_plotinfo_130801.csv":{ + "sep":"c", + "contents":""}, + "nz_traits_130801.csv":{ + "sep":"c", + "contents":""}, + "nz_treedata_growth_130801.csv":{ + "sep":"c", + "contents":"" } + } } diff --git a/ms/metadata/NVS/files/nz_traits_130801.csv b/ms/metadata/NVS/files/nz_traits_130801.csv index d9579f9c9b4704e6f913cfe14d3cdcebceadcff5..5156229c2e15170e05418fa27b5da187a00a7cf7 100644 --- a/ms/metadata/NVS/files/nz_traits_130801.csv +++ b/ms/metadata/NVS/files/nz_traits_130801.csv @@ -1,8 +1,8 @@ use,var,units,description 0,X,, 0,SpeciesCode,, -0,lma.gm2,, -0,leafn,, -0,height.m,, -0,wood,, -0,seed.mg,, +0,lma.gm2,g/m2,leaf mass per area +0,leafn,,leaf nitrogen content +0,height.m,m,height +0,wood,,wood density +0,seed.mg,mg,seed mass diff --git a/ms/metadata/NVS/files/nz_treedata_growth_130801.csv b/ms/metadata/NVS/files/nz_treedata_growth_130801.csv index 67bf47197ec09be0ebe6fb63c60bb8c84e24ab47..251fc4e3a33e321770212dd9aeb2cd6166be3c95 100644 --- a/ms/metadata/NVS/files/nz_treedata_growth_130801.csv +++ b/ms/metadata/NVS/files/nz_treedata_growth_130801.csv @@ -1,11 +1,11 @@ use,var,units,description 0,X,, -0,surv,, -0,plid,, -0,tag,, -0,sp,, -0,t0,, -0,t1,, -0,D0,, -0,D1,, -0,GF,, +0,surv,,Plots were established along randomly directed lines within river catchments (=surveys)# +0,plid,,names of plots are pasted on to the end of the survey name +0,tag,,unique tag code for each tree is pasted on to the end of the plotid +0,sp,,"species code. First 3 letters gives genus, second 3 letters species." +0,t0,,the years in which measurements were taken. This varies among surveys (should usually be the same within a survey) +0,t1,,the years in which measurements were taken. This varies among surveys (should usually be the same within a survey) +0,D0,,"stem diameter (cm) at D0. Missing initial value indicates a recruit, missing final value indicates a death. " +0,D1,,"stem diameter (cm) at D0. Missing initial value indicates a recruit, missing final value indicates a death. " +0,GF,,"growth form (canopy tree CT, SH = Shrub or UT= understorey trees)" \ No newline at end of file diff --git a/ms/metadata/Paracou/_file_index.csv b/ms/metadata/Paracou/_file_index.csv deleted file mode 100644 index 496052f84c01a504b3efd5d8988c1b1306a9f191..0000000000000000000000000000000000000000 --- a/ms/metadata/Paracou/_file_index.csv +++ /dev/null @@ -1,8 +0,0 @@ -filename,sep,skip,contents -20130717_paracou_1984_2012.csv,;,0, -20130717_paracou_codes_mesure.csv,;,0, -20130717_paracou_taxonomie.csv,;,0, -Autour de Paracou - Releves par trait et taxon.txt,t,0, -bridge.csv,t,0, -BridgeDATA.g.csv,;,0, -WD-Species-Paracou-Ervan_GV.csv, " ",0, diff --git a/ms/metadata/Paracou/_site_details.JSON b/ms/metadata/Paracou/_site_details.JSON index f9e9e6e0cab468b4c3c26f63d2bf88af20b0ae96..25354388131e1fd1bca47211acd04c9d05b740b8 100644 --- a/ms/metadata/Paracou/_site_details.JSON +++ b/ms/metadata/Paracou/_site_details.JSON @@ -4,6 +4,7 @@ "email": "ghislain.vieilledent@cirad.fr", "affiliation": "Cirad :: UR105 :: Biens et Services des Ecosystèmes Forestiers, Montpellier France" }, + "agreement": "", "dataset": { "name": "Paracou", "country": "France, French Guiana", @@ -19,5 +20,28 @@ "references": [ "", "" - ] + ], + "files":{ + "20130717_paracou_1984_2012.csv":{ + "sep":";", + "contents":""}, + "20130717_paracou_codes_mesure.csv":{ + "sep":";", + "contents":""}, + "20130717_paracou_taxonomie.csv":{ + "sep":";", + "contents":""}, + "Autour-de-Paracou-Releves-par-trait-et-taxon":{ + "sep":";", + "contents":""}, + "bridge.csv":{ + "sep":";", + "contents":""}, + "BridgeDATA.g.csv":{ + "sep":";", + "contents":""}, + "WD-Species-Paracou-Ervan_GV.csv":{ + "sep":";", + "contents":""} + } } diff --git a/ms/metadata/Paracou/files/Autour de Paracou - Releves par trait et taxon.csv b/ms/metadata/Paracou/files/Autour-de-Paracou-Releves-par-trait-et-taxon.csv similarity index 100% rename from ms/metadata/Paracou/files/Autour de Paracou - Releves par trait et taxon.csv rename to ms/metadata/Paracou/files/Autour-de-Paracou-Releves-par-trait-et-taxon.csv diff --git a/ms/metadata/Spain/_file_index.csv b/ms/metadata/Spain/_file_index.csv deleted file mode 100644 index 99a705eca480d93480958e23714d371bcea083c4..0000000000000000000000000000000000000000 --- a/ms/metadata/Spain/_file_index.csv +++ /dev/null @@ -1,4 +0,0 @@ -filename,sep,skip,contents -R_Ecoregion.csv,c,0, -Tree_data_SFI_aug13_alldata.txt,t,0, -Tree_data_SFI.txt,t,0, diff --git a/ms/metadata/Spain/_site_details.JSON b/ms/metadata/Spain/_site_details.JSON index fa0265f2d923d86809ffa5dbfb5b1a5cc347331b..7c18df82c607c52178bd840986d84d3b4fe39032 100644 --- a/ms/metadata/Spain/_site_details.JSON +++ b/ms/metadata/Spain/_site_details.JSON @@ -4,20 +4,32 @@ "email": "madezavala@gmail.com", "affiliation": "Departamento de Ecologia, Universidad de Alcala, Spain" }, + "agreement": "", "dataset": { - "name": "SFI", + "name": "Spanish Forest Inventory Dataset", "country": "Spain", "climate": "", "vegetation type": "", "latitude": -1, "longitude": -1, "minimum tree size": "", - "history": "", + "history": "The Spanish Forest Inventory (SFI) has two consecutive and comparable censuses, the second SFI (2SFI, 1986-1996) and the third SFI (3SFI, 1997-2007). The plots are systematically distributed over a grid cell of 1km over forest ecosystems. Each SFI plot included four concentric circular sub-plots of 5, 10, 15 and 25-m radius. In these sub-plots, adult trees were sampled when diameter at breast height (d.b.h.) was 7.5-12.4 cm, 12.5-22.4 cm, 22.5-42.5 cm and >= 42.5 cm, respectively. All the provinces comparable were included (i.e. Canarias Islands are in the data attached).", "field methodology": "", "trait information": "" }, "references": [ "", "" - ] + ], + "files":{ + "R_Ecoregion.csv":{ + "sep":"c", + "contents":""}, + "Tree_data_SFI_aug13_alldata.txt":{ + "sep":"c", + "contents":""}, + "Tree_data_SFI.txt":{ + "sep":"c", + "contents":"" } + } } diff --git a/ms/metadata/Spain/calculations.md b/ms/metadata/Spain/calculations.md new file mode 100644 index 0000000000000000000000000000000000000000..a447b2cc1d78408f0ef74c1d9e0c7483b6290b98 --- /dev/null +++ b/ms/metadata/Spain/calculations.md @@ -0,0 +1,6 @@ + + +### 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. diff --git a/ms/metadata/Spain/files/Tree_data_SFI_aug13_alldata.csv b/ms/metadata/Spain/files/Tree_data_SFI_aug13_alldata.csv index e4429e5364eb90378b8ec7d13af6312367c58761..f3536c0ec62b2b2c14630649036b403ecb29e75d 100644 --- a/ms/metadata/Spain/files/Tree_data_SFI_aug13_alldata.csv +++ b/ms/metadata/Spain/files/Tree_data_SFI_aug13_alldata.csv @@ -1,25 +1,25 @@ use,var,units,description -0,Tree_ID_SFI,, -0,Plot_ID_SFI,, -0,CX,, -0,CY,, -0,Dist,, -0,Angle,, -0,SP_code,, -0,SP_name,, -0,Life_status,, -0,ht1,, -0,ht2,, -0,dbh1,, -0,dbh2,, -0,years,, -0,adbh,, +0,Tree_ID_SFI,,individual identifier +0,Plot_ID_SFI,, plot identifier +0,CX,,plots coordinates +0,CY,,plots coordinates +0,Dist,m,"Distance to the plot center. Combined with Angle, gives polar coordinates of tree position in plot. Cab be used to calculate XY position" +0,Angle,deg,Angle of tree from centre of plot = horizontal angular degrees from north following clockwise +0,SP_code,,species code +0,SP_name,,species name +0,Life_status,,"alive, dead, recruit" +0,ht1,m,height at census 1 +0,ht2,m,height at census 2 +0,dbh1,mm,diameter at census 1 +0,dbh2,mm,diameter at census 2 +0,years,yrs,No. years at provincial level +0,adbh,mm/ha/yr,diameter growth between intervals (= dbh2 - dbh1) 0,neg_grwoth,, -0,BA1_m2ha,, -0,BA2_m2ha,, -0,R1,, -0,R2,, -0,mat,, -0,pp,, -0,PET,, -0,Mortality_Cut,, +0,BA1_m2ha,m2/ha,basal area per hectare for each individual (using radius R1) +0,BA2_m2ha,m2/ha,basal area per hectare for each individual (using radius R2) +0,R1,,plot or quadrat size: R2 (radius in the 2SFI) and R3 (radius in the 3SFI). The SFI have a variable radius +0,R2,,plot or quadrat size: R2 (radius in the 2SFI) and R3 (radius in the 3SFI). The SFI have a variable radius +0,mat,degC,"mean annual temperature, from Gonzalo (2008) " +0,pp,mm,annual precipitation from Gonzalo (2008) +0,PET,mm,Thorntwaite evapotranspiration +0,Mortality_Cut,,"includes harvesting, selective thinning between the two consecutive inventories. 0- NO, 1- YES, 2-UNKNOWN." \ No newline at end of file diff --git a/ms/metadata/Sweden/_file_index.csv b/ms/metadata/Sweden/_file_index.csv deleted file mode 100644 index 2522b0eb0b2728f846e7e99f9a750b475a7c47ef..0000000000000000000000000000000000000000 --- a/ms/metadata/Sweden/_file_index.csv +++ /dev/null @@ -1,4 +0,0 @@ -filename,sep,skip,contents -Swe_NFI_1.csv,c,0, -Swe_NFI_2a.csv,c,0, -Swe_NFI_3.csv,c,0, diff --git a/ms/metadata/Sweden/_site_details.JSON b/ms/metadata/Sweden/_site_details.JSON index cfe1f98cd6698fa74eea5d2c2da758791411471d..7e5f80704123efda0e39523aa2a9ae6d1a82df30 100644 --- a/ms/metadata/Sweden/_site_details.JSON +++ b/ms/metadata/Sweden/_site_details.JSON @@ -5,8 +5,8 @@ "affiliation": "Swedish University of Agricultural Sciences, Department of Forest Resource Management, SE-901 83 Umeå, Sweden" }, "dataset": { - "name": "", - "country": "", + "name": "Swedish National Forestry Inventory dataset", + "country": "Sweden", "climate": "", "vegetation type": "", "latitude": -1, @@ -19,5 +19,16 @@ "references": [ "", "" - ] + ], + "files":{ + "Swe_NFI_1.csv":{ + "sep":"c", + "contents":""}, + "Swe_NFI_2a.csv":{ + "sep":"c", + "contents":""}, + "Swe_NFI_3.csv":{ + "sep":"c", + "contents":"" } + } } diff --git a/ms/metadata/Sweden/files/Swe_NFI_1.csv b/ms/metadata/Sweden/files/Swe_NFI_1.csv index 45dd7a2026c5ba3d94243ca921b01a69c93c1894..68acbe6da67ae383de75dedb39c4a5a49741607e 100644 --- a/ms/metadata/Sweden/files/Swe_NFI_1.csv +++ b/ms/metadata/Sweden/files/Swe_NFI_1.csv @@ -1 +1,33 @@ -use,var,units,description 0,PlotInventID,,Unique sample plot ID 0,Year,,Inventory year 0,TractNr,,Plot cluster number 0,PlotNr,,Plot number 0,TreeNr,,Tree number 0,TreeSpecies,,See code list of tree species 0,Diameter,mm,Diameter at breast height mm 0,Volume,m3,Stem volume in m3 0,BrhAge,yr,Age a breast height 0,Increment,m3,Increment of stem volume in m3 0,TreeID,,Unique tree ID 0,PlotArea,m2,sample plot area in m2 0,County,, 0,StandAge,,Mean age of the stand 0,MeanHeight,m, 0,BasalArea,m2/ha, 0,PlotArea0139,,plot area for trees with diameter 1 mm-39 mm 0,PlotArea4099,,plot area for trees with diameter 40 mm-99 mm 0,PlotArea100,,plot area for trees with diameter 100+ mm 0,FellingYear,,Inventory year when the tree was registred as felled 0,fellingVolume,m3,volume of felled tree in m3 0,DeadYear,,Inventory year when the tree was first registred as dead 0,DeadDia,mm,diameter of the dead tree 0,DeadVolume,m3,volume of dead tree 0,ncoord,,North coordinate -SWEREF-TM 0,ecoord,,East coordinate -SWEREF-TM 0,dia_t1,mm,Diameter at the first inventory (2003-2007) 0,vol_t1,m3,Volume at the first inventory (2003-2007) 0,DryW_t1,kg,dry weight at the fist inventory (2003-2007) 0,dia_t2,mm,Diameter at the second inventory (2008-2012) 0,vol_t2,m3,Volume at the second inventory (2008-2012) 0,DryW_t2,kg,dry weight at the second inventory (2008-2012) \ No newline at end of file +use,var,units,description +0,PlotInventID,,Unique sample plot ID +0,Year,,Inventory year +0,TractNr,,Plot cluster number +0,PlotNr,,Plot number +0,TreeNr,,Tree number +0,TreeSpecies,,See code list of tree species +0,Diameter,mm,Diameter at breast height mm +0,Volume,m3,Stem volume in m3 +0,BrhAge,yr,Age a breast height +0,Increment,m3,Increment of stem volume in m3 +0,TreeID,,Unique tree ID +0,PlotArea,m2,sample plot area in m2 +0,County,, +0,StandAge,,Mean age of the stand +0,MeanHeight,m, +0,BasalArea,m2/ha, +0,PlotArea0139,,plot area for trees with diameter 1 mm-39 mm +0,PlotArea4099,,plot area for trees with diameter 40 mm-99 mm +0,PlotArea100,,plot area for trees with diameter 100+ mm +0,FellingYear,,Inventory year when the tree was registred as felled +0,fellingVolume,m3,volume of felled tree in m3 +0,DeadYear,,Inventory year when the tree was first registred as dead +0,DeadDia,mm,diameter of the dead tree +0,DeadVolume,m3,volume of dead tree +0,ncoord,,North coordinate -SWEREF-TM +0,ecoord,,East coordinate -SWEREF-TM +0,dia_t1,mm,Diameter at the first inventory (2003-2007) +0,vol_t1,m3,Volume at the first inventory (2003-2007) +0,DryW_t1,kg,dry weight at the fist inventory (2003-2007) +0,dia_t2,mm,Diameter at the second inventory (2008-2012) +0,vol_t2,m3,Volume at the second inventory (2008-2012) +0,DryW_t2,kg,dry weight at the second inventory (2008-2012) \ No newline at end of file diff --git a/ms/metadata/Sweden/files/Swe_NFI_2a.csv b/ms/metadata/Sweden/files/Swe_NFI_2a.csv index 45dd7a2026c5ba3d94243ca921b01a69c93c1894..68acbe6da67ae383de75dedb39c4a5a49741607e 100644 --- a/ms/metadata/Sweden/files/Swe_NFI_2a.csv +++ b/ms/metadata/Sweden/files/Swe_NFI_2a.csv @@ -1 +1,33 @@ -use,var,units,description 0,PlotInventID,,Unique sample plot ID 0,Year,,Inventory year 0,TractNr,,Plot cluster number 0,PlotNr,,Plot number 0,TreeNr,,Tree number 0,TreeSpecies,,See code list of tree species 0,Diameter,mm,Diameter at breast height mm 0,Volume,m3,Stem volume in m3 0,BrhAge,yr,Age a breast height 0,Increment,m3,Increment of stem volume in m3 0,TreeID,,Unique tree ID 0,PlotArea,m2,sample plot area in m2 0,County,, 0,StandAge,,Mean age of the stand 0,MeanHeight,m, 0,BasalArea,m2/ha, 0,PlotArea0139,,plot area for trees with diameter 1 mm-39 mm 0,PlotArea4099,,plot area for trees with diameter 40 mm-99 mm 0,PlotArea100,,plot area for trees with diameter 100+ mm 0,FellingYear,,Inventory year when the tree was registred as felled 0,fellingVolume,m3,volume of felled tree in m3 0,DeadYear,,Inventory year when the tree was first registred as dead 0,DeadDia,mm,diameter of the dead tree 0,DeadVolume,m3,volume of dead tree 0,ncoord,,North coordinate -SWEREF-TM 0,ecoord,,East coordinate -SWEREF-TM 0,dia_t1,mm,Diameter at the first inventory (2003-2007) 0,vol_t1,m3,Volume at the first inventory (2003-2007) 0,DryW_t1,kg,dry weight at the fist inventory (2003-2007) 0,dia_t2,mm,Diameter at the second inventory (2008-2012) 0,vol_t2,m3,Volume at the second inventory (2008-2012) 0,DryW_t2,kg,dry weight at the second inventory (2008-2012) \ No newline at end of file +use,var,units,description +0,PlotInventID,,Unique sample plot ID +0,Year,,Inventory year +0,TractNr,,Plot cluster number +0,PlotNr,,Plot number +0,TreeNr,,Tree number +0,TreeSpecies,,See code list of tree species +0,Diameter,mm,Diameter at breast height mm +0,Volume,m3,Stem volume in m3 +0,BrhAge,yr,Age a breast height +0,Increment,m3,Increment of stem volume in m3 +0,TreeID,,Unique tree ID +0,PlotArea,m2,sample plot area in m2 +0,County,, +0,StandAge,,Mean age of the stand +0,MeanHeight,m, +0,BasalArea,m2/ha, +0,PlotArea0139,,plot area for trees with diameter 1 mm-39 mm +0,PlotArea4099,,plot area for trees with diameter 40 mm-99 mm +0,PlotArea100,,plot area for trees with diameter 100+ mm +0,FellingYear,,Inventory year when the tree was registred as felled +0,fellingVolume,m3,volume of felled tree in m3 +0,DeadYear,,Inventory year when the tree was first registred as dead +0,DeadDia,mm,diameter of the dead tree +0,DeadVolume,m3,volume of dead tree +0,ncoord,,North coordinate -SWEREF-TM +0,ecoord,,East coordinate -SWEREF-TM +0,dia_t1,mm,Diameter at the first inventory (2003-2007) +0,vol_t1,m3,Volume at the first inventory (2003-2007) +0,DryW_t1,kg,dry weight at the fist inventory (2003-2007) +0,dia_t2,mm,Diameter at the second inventory (2008-2012) +0,vol_t2,m3,Volume at the second inventory (2008-2012) +0,DryW_t2,kg,dry weight at the second inventory (2008-2012) \ No newline at end of file diff --git a/ms/metadata/Sweden/files/Swe_NFI_3.csv b/ms/metadata/Sweden/files/Swe_NFI_3.csv index 45dd7a2026c5ba3d94243ca921b01a69c93c1894..68acbe6da67ae383de75dedb39c4a5a49741607e 100644 --- a/ms/metadata/Sweden/files/Swe_NFI_3.csv +++ b/ms/metadata/Sweden/files/Swe_NFI_3.csv @@ -1 +1,33 @@ -use,var,units,description 0,PlotInventID,,Unique sample plot ID 0,Year,,Inventory year 0,TractNr,,Plot cluster number 0,PlotNr,,Plot number 0,TreeNr,,Tree number 0,TreeSpecies,,See code list of tree species 0,Diameter,mm,Diameter at breast height mm 0,Volume,m3,Stem volume in m3 0,BrhAge,yr,Age a breast height 0,Increment,m3,Increment of stem volume in m3 0,TreeID,,Unique tree ID 0,PlotArea,m2,sample plot area in m2 0,County,, 0,StandAge,,Mean age of the stand 0,MeanHeight,m, 0,BasalArea,m2/ha, 0,PlotArea0139,,plot area for trees with diameter 1 mm-39 mm 0,PlotArea4099,,plot area for trees with diameter 40 mm-99 mm 0,PlotArea100,,plot area for trees with diameter 100+ mm 0,FellingYear,,Inventory year when the tree was registred as felled 0,fellingVolume,m3,volume of felled tree in m3 0,DeadYear,,Inventory year when the tree was first registred as dead 0,DeadDia,mm,diameter of the dead tree 0,DeadVolume,m3,volume of dead tree 0,ncoord,,North coordinate -SWEREF-TM 0,ecoord,,East coordinate -SWEREF-TM 0,dia_t1,mm,Diameter at the first inventory (2003-2007) 0,vol_t1,m3,Volume at the first inventory (2003-2007) 0,DryW_t1,kg,dry weight at the fist inventory (2003-2007) 0,dia_t2,mm,Diameter at the second inventory (2008-2012) 0,vol_t2,m3,Volume at the second inventory (2008-2012) 0,DryW_t2,kg,dry weight at the second inventory (2008-2012) \ No newline at end of file +use,var,units,description +0,PlotInventID,,Unique sample plot ID +0,Year,,Inventory year +0,TractNr,,Plot cluster number +0,PlotNr,,Plot number +0,TreeNr,,Tree number +0,TreeSpecies,,See code list of tree species +0,Diameter,mm,Diameter at breast height mm +0,Volume,m3,Stem volume in m3 +0,BrhAge,yr,Age a breast height +0,Increment,m3,Increment of stem volume in m3 +0,TreeID,,Unique tree ID +0,PlotArea,m2,sample plot area in m2 +0,County,, +0,StandAge,,Mean age of the stand +0,MeanHeight,m, +0,BasalArea,m2/ha, +0,PlotArea0139,,plot area for trees with diameter 1 mm-39 mm +0,PlotArea4099,,plot area for trees with diameter 40 mm-99 mm +0,PlotArea100,,plot area for trees with diameter 100+ mm +0,FellingYear,,Inventory year when the tree was registred as felled +0,fellingVolume,m3,volume of felled tree in m3 +0,DeadYear,,Inventory year when the tree was first registred as dead +0,DeadDia,mm,diameter of the dead tree +0,DeadVolume,m3,volume of dead tree +0,ncoord,,North coordinate -SWEREF-TM +0,ecoord,,East coordinate -SWEREF-TM +0,dia_t1,mm,Diameter at the first inventory (2003-2007) +0,vol_t1,m3,Volume at the first inventory (2003-2007) +0,DryW_t1,kg,dry weight at the fist inventory (2003-2007) +0,dia_t2,mm,Diameter at the second inventory (2008-2012) +0,vol_t2,m3,Volume at the second inventory (2008-2012) +0,DryW_t2,kg,dry weight at the second inventory (2008-2012) \ No newline at end of file diff --git a/ms/metadata/Swiss/_file_index.csv b/ms/metadata/Swiss/_file_index.csv deleted file mode 100644 index 11f35fa88d558cb2e57e3cb3b49862b7992cf41f..0000000000000000000000000000000000000000 --- a/ms/metadata/Swiss/_file_index.csv +++ /dev/null @@ -1,5 +0,0 @@ -filename,sep,skip,contents -LFI12.csv,c,0, -LFI1to4.csv,c,0, -LFI23.csv,c,0, -LFI34.csv,c,0, diff --git a/ms/metadata/Swiss/_site_details.JSON b/ms/metadata/Swiss/_site_details.JSON index 58e3767f937e847a88fd2d56d8800e6b2205736c..a0a56d76f65e24806e1f06e204c8c57f44f52792 100644 --- a/ms/metadata/Swiss/_site_details.JSON +++ b/ms/metadata/Swiss/_site_details.JSON @@ -4,6 +4,7 @@ "email": "niklaus.zimmermann@wsl.ch", "affiliation": "WSL Birsmensdorf Switzerland" }, + "agreement": "", "dataset": { "name": "LFI", "country": "Switzerland", @@ -16,8 +17,14 @@ "field methodology": "", "trait information": "" }, - "references": [ - "", - "" - ] + "references": ["", + ""], + "files":{ + "LFI12.csv":{ + "sep":"c", + "contents":""}, + "LFI1to4.csv":{ + "sep":"c", + "contents":""} + } } diff --git a/ms/metadata/Swiss/files/LFI12.csv b/ms/metadata/Swiss/files/LFI12.csv index 9c637372d89aa01d8ded88172477d9dea78a60a9..9b26745ba97206aa1db70ba1ec8571b816e5bcdc 100644 --- a/ms/metadata/Swiss/files/LFI12.csv +++ b/ms/metadata/Swiss/files/LFI12.csv @@ -5,22 +5,22 @@ use,var,units,description 0,BANR,, 0,X,, 0,Y,, -0,BAUMART,, +0,BAUMART,,Code of tree (shrub) species (see separate file). 0,TEXT,, -0,VEGPER,, -0,BHD1,, -0,BHD2,, -0,BA1,, -0,BA2,, -0,BAI,, -0,BHD_DIFF,, -0,RPSTZ1,, -0,RPSTZ2,, -0,HOEHE1,, -0,HOEHE2,, -0,ALTERD1,, -0,BESTALT1,, -0,ALTERD2,, -0,BESTALT2,, -0,WTYP1,, -0,WTYP2,, +0,VEGPER,yrs,"# of vegetation periods (usually in _ years), between two measurement dates." +0,BHD1,cm,"Census 1 - Diameter at breast height (derived from D13). For trees with DBH <= 60 cm it is measured by a (slide) caliper, for DBH > 60 cm it is calculated from the circumference." +0,BHD2,cm,"Census 2 - Diameter at breast height (derived from D13). For trees with DBH <= 60 cm it is measured by a (slide) caliper, for DBH > 60 cm it is calculated from the circumference." +0,BA1,cm2,Census 1 - Basal Area of a tree at 1.3m height (where DBH is measured) +0,BA2,cm2,Census 2 - Basal Area of a tree at 1.3m height (where DBH is measured) +0,BAI,cm2,BA2 - BA1; basal area increment +0,BHD_DIFF,cm,BHD2 - BHD1; DBH increment +0,RPSTZ1,/ha,"Census 1 - Factor of repreentation of each tree in the two concentric circles (with differing minimum DBH to enter inventory). Each tree measured on a plot represents a certain number of trees on a hectare. The factor is not identical for all tress in a plot, but depends on diameter (larger or smaller 35cm), and may be further influenced by plot delineations that deviated from the standard plot size (e.g. when a road crosses a plot, or a forest edge reduces the plot size, etc.). The representation factor is larger the smaller the area of the plot." +0,RPSTZ2,/ha,Census 2 - Factor of repreentation of each tree as per RPSTZ1 +0,HOEHE1,m,Census 1 - Tree height measurememt (in m). Trees on a plot are determined randomly. +0,HOEHE2,m,Census 2 - Tree height measurememt (in m). Trees on a plot are determined randomly. +0,ALTERD1,yr,Census 1 - AGE of individual estimated from a model +0,BESTALT1,yr,"Census 1 STAND AGE: is only measured in +/- even aged forests. Is measured from tree rings, or from twig whorls, but is sometimes also estimated/guessed." +0,ALTERD2,yr,Census 2 - AGE of individual estimated from a model +0,BESTALT2,yr,"Census 2 STAND AGE: is only measured in +/- even aged forests. Is measured from tree rings, or from twig whorls, but is sometimes also estimated/guessed." +0,WTYP1,,Census 1 - FOREST TYPE in 17 classes. +0,WTYP2,,Census 2 - FOREST TYPE in 17 classes. diff --git a/ms/metadata/Swiss/files/LFI23.csv b/ms/metadata/Swiss/files/LFI23.csv deleted file mode 100644 index 9c637372d89aa01d8ded88172477d9dea78a60a9..0000000000000000000000000000000000000000 --- a/ms/metadata/Swiss/files/LFI23.csv +++ /dev/null @@ -1,26 +0,0 @@ -use,var,units,description -0,ID,, -0,INVNR,, -0,CLNR,, -0,BANR,, -0,X,, -0,Y,, -0,BAUMART,, -0,TEXT,, -0,VEGPER,, -0,BHD1,, -0,BHD2,, -0,BA1,, -0,BA2,, -0,BAI,, -0,BHD_DIFF,, -0,RPSTZ1,, -0,RPSTZ2,, -0,HOEHE1,, -0,HOEHE2,, -0,ALTERD1,, -0,BESTALT1,, -0,ALTERD2,, -0,BESTALT2,, -0,WTYP1,, -0,WTYP2,, diff --git a/ms/metadata/Swiss/files/LFI34.csv b/ms/metadata/Swiss/files/LFI34.csv deleted file mode 100644 index 9c637372d89aa01d8ded88172477d9dea78a60a9..0000000000000000000000000000000000000000 --- a/ms/metadata/Swiss/files/LFI34.csv +++ /dev/null @@ -1,26 +0,0 @@ -use,var,units,description -0,ID,, -0,INVNR,, -0,CLNR,, -0,BANR,, -0,X,, -0,Y,, -0,BAUMART,, -0,TEXT,, -0,VEGPER,, -0,BHD1,, -0,BHD2,, -0,BA1,, -0,BA2,, -0,BAI,, -0,BHD_DIFF,, -0,RPSTZ1,, -0,RPSTZ2,, -0,HOEHE1,, -0,HOEHE2,, -0,ALTERD1,, -0,BESTALT1,, -0,ALTERD2,, -0,BESTALT2,, -0,WTYP1,, -0,WTYP2,, diff --git a/ms/metadata/TRY/_file_index.csv b/ms/metadata/TRY/_file_index.csv deleted file mode 100644 index 381b336eabb30d2697bbe3e862aa2524ba74593d..0000000000000000000000000000000000000000 --- a/ms/metadata/TRY/_file_index.csv +++ /dev/null @@ -1,3 +0,0 @@ -filename,sep,skip,contents -TRY_Proposal_177_DataRelease_2013_04_01.txt,t,0, -TRY_Proposal_177_DataRelease_2013_07_23.txt,t,0, diff --git a/ms/metadata/TRY/_site_details.JSON b/ms/metadata/TRY/_site_details.JSON index d598cd134ffb5396338e4e5c21c59b814ee04c61..b8fe9e55075dbdd954105a88863df85172c75ea5 100644 --- a/ms/metadata/TRY/_site_details.JSON +++ b/ms/metadata/TRY/_site_details.JSON @@ -4,6 +4,7 @@ "email": "jkattge@bgc-jena.mpg.de", "affiliation": "Max-Planck-Institute for Biogeochemistry, 07745 Jena, Germany" }, + "agreement": "", "dataset": { "name": "TRY" }, diff --git a/ms/metadata/US/_file_index.csv b/ms/metadata/US/_file_index.csv deleted file mode 100644 index de317a5945a8e62ba6a4a91a52cc4852b1ed656e..0000000000000000000000000000000000000000 --- a/ms/metadata/US/_file_index.csv +++ /dev/null @@ -1,5 +0,0 @@ -filename,sep,skip,contents -EcoregionCodes.csv,c,0, -FIA51_trees_w_supp.csv,c,0, -FIAspeciesCodes.csv,c,0, -FiaSpMaxHt.csv,c,0, diff --git a/ms/metadata/US/_site_details.JSON b/ms/metadata/US/_site_details.JSON index adce49715010310fb76db7e123687b21a4ad2c68..d579924abe1884f7a4bd23270da5b4ac07c122ab 100644 --- a/ms/metadata/US/_site_details.JSON +++ b/ms/metadata/US/_site_details.JSON @@ -4,8 +4,9 @@ "email": "mark.vanderwel@ufl.edu", "affiliation": "University of Florida" }, + "agreement": "", "dataset": { - "name": "FIA", + "name": "United States Forest Inventory Dataset", "country": "US", "climate": "", "vegetation type": "", @@ -16,8 +17,20 @@ "field methodology": "", "trait information": "" }, - "references": [ - "Vanderwel, M.C., Lyutsarev, V.S., and Purves, D.W. (2013). Climate-related variation in mortality and recruitment determine regional forest-type distributions. Global Ecology and Biogeography n/a–n/a.", - "" - ] + "references": ["Vanderwel, M.C., Lyutsarev, V.S., and Purves, D.W. (2013). Climate-related variation in mortality and recruitment determine regional forest-type distributions. Global Ecology and Biogeography n/a–n/a.", + ""], + "files":{ + "EcoregionCodes.csv":{ + "sep":"c", + "contents":""}, + "FIA51_trees_w_supp.csv":{ + "sep":"c", + "contents":""}, + "FIAspeciesCodes.csv":{ + "sep":"c", + "contents":""}, + "FiaSpMaxHt.csv":{ + "sep":"c", + "contents":""} + } } diff --git a/ms/metadata/US/files/FIA51_trees_w_supp.csv b/ms/metadata/US/files/FIA51_trees_w_supp.csv index 3f3bc575d1bd94db7309be679883788bce6a4cfc..78072e7c281a29ff4a7a31e5c010457820e75e66 100644 --- a/ms/metadata/US/files/FIA51_trees_w_supp.csv +++ b/ms/metadata/US/files/FIA51_trees_w_supp.csv @@ -1,15 +1,15 @@ use,var,units,description -0,TreeID,, -0,Species,, -0,InitDbh,, -0,FinalDbh,, -0,PlotID,, -0,SubplotNumber,, -0,PlotSize,, -0,Lat,, -0,Lon,, -0,IndWeight,, -0,IntervalYears,, -0,Ecocode,, -0,MAT,, -0,MAP,, +0,TreeID,,A tree identifier field. +0,Species,, FIA species code. The species names can be looked up from a separate file (Canadian_species.csv) +0,InitDbh,,"DBH at the first measurement, in cm. Set to 0 if the tree was not included in the first measurement." +0,FinalDbh,,"DBH at the second measurement, in cm. Set to -999 if the tree was dead at the second measurement." +0,PlotID,, A plot identifier field. +0,SubplotNumber,,"Subplot identifier. Each plot consists of up to four subplots. I've removed all subplots that were harvested between measurements, that crossed a stand boundary, or that had no trees." +0,PlotSize,ha,"This is the total area, in ha, of all the subplots included in each tree's plot. The size of each subplot depends on the DBH of the tree that was recorded." +0,Lat,deg,"Plot latitude, in decimal degrees." +0,Lon,deg,"Plot longitude, in decimal degrees." +0,IndWeight,#/ha,This is the weighting (#/ha) assigned to each tree for calculating plot basal area. It is just 1/PlotSize. +0,IntervalYears,yrs,"The duration of the interval between measurements, in years." +0,Ecocode,,"The code corresponding to this plot's ecoregion. The names can be looked up from a separate file (EcoregionCodes.csv). There is a 3-level hierarchy of ecoregions (domain, division, province). It may be worth aggregating ecoregions to the division level to reduce the number of separate units." +0,MAT,,"Mean annual temperature from 1961-1990 for this plot's location, from the WorldClim database." +0,MAP,,"Mean annual precipitation from 1961-1990 for this plot's location, from the WorldClim database." diff --git a/ms/metadata/US/files/FiaSpMaxHt.csv b/ms/metadata/US/files/FiaSpMaxHt.csv index 4dc4c13af19dcf795201fce7db860bbea192aa1a..07e7137fca7776dca571662c6ad4c78b2a027731 100644 --- a/ms/metadata/US/files/FiaSpMaxHt.csv +++ b/ms/metadata/US/files/FiaSpMaxHt.csv @@ -1,3 +1,3 @@ use,var,units,description -0,SpCd,, -0,Ht99,, +0,SpCd,, species code +0,Ht99,m, Maximum height diff --git a/ms/site_description.Rmd b/ms/site_description.Rmd index 0af1126e0ec3e113c630404b1ddced54355aa17a..2983f2f416e2cb0ade714bd98ad06ea2c9d1dc32 100644 --- a/ms/site_description.Rmd +++ b/ms/site_description.Rmd @@ -3,11 +3,10 @@ opts_chunk$set(warnings = FALSE) # LOAD SITE DETAILS -files <- read.csv(file.path(DIR,"_file_index.csv"), stringsAsFactors=FALSE) json_file <- file.path(DIR,"_site_details.JSON") details <- fromJSON(paste(readLines(json_file), collapse="")) -# FUNCTIONS FOR FOMRATTING TABLES +# FUNCTIONS FOR FORMATTING TABLES pandify <- function(data.table){ pandoc.table.return(data.table, styl="multiline", split.tables= 200, split.cells = 50, justify = "left") } @@ -23,6 +22,13 @@ for(l in names(details$contact)) writeLines(paste0("**",l,"**: ", details$contact[[l]], "\n")) ``` +## Dataset availability / usage agreement + +```{r,results="asis",echo=FALSE} + writeLines(paste0(details$agreement, "\n")) +``` + + ## Dataset ```{r,results="asis",echo=FALSE} @@ -30,7 +36,6 @@ for(l in names(details$dataset)) writeLines(paste0("**",l,"**: ", details$dataset[[l]], "\n")) ``` - ## References ```{r,results="asis",echo=FALSE} @@ -45,20 +50,19 @@ Below is a list of the various files provided for this dataset, and the variable ```{r,results="asis",echo=FALSE} -for(i in 1:length(files[,1])){ +for(n in names(details$files)){ writeLines("\\newpage \n") - filename <- file.path(DIR, "files", paste0(tools::file_path_sans_ext( gsub("/", "_", files[i,1])), ".csv")) + filename <- file.path(DIR, "files", paste0(tools::file_path_sans_ext( gsub("/", "_", n)), ".csv")) mytext <- pandify(read.csv(filename, stringsAsFactors=FALSE)) - writeLines(paste0("### ",files[i,"filename"],"\n")) - writeLines(paste0(files[i,"contents"], "\n")) + writeLines(paste0("### ", n,"\n")) + writeLines(paste0( details$files[[n]]$contents, "\n")) writeLines(mytext) - } ``` ## Calculations -Details on data manipulations required for sue of this dataset in this study. +Details on data manipulations required for use of this dataset in this study. ```{r,results="asis",echo=FALSE} filename <- file.path(DIR,"calculations.md")