Commit 758c07dd authored by Daniel Falster's avatar Daniel Falster
Browse files

Move file list into JSON file

No related merge requests found
Showing with 32 additions and 24 deletions
+32 -24
...@@ -17,8 +17,14 @@ ...@@ -17,8 +17,14 @@
"field methodology": "", "field methodology": "",
"trait information": "" "trait information": ""
}, },
"references": [ "references": ["",
"", ""],
"" "files":{
] "LFI12.csv":{
"sep":"c",
"contents":""},
"LFI1to4.csv":{
"sep":"c",
"contents":""}
}
} }
...@@ -12,7 +12,7 @@ use,var,units,description ...@@ -12,7 +12,7 @@ use,var,units,description
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,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,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,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,BAI,cm2,BA2 - BA1; basal area increment
0,BHD_DIFF,cm,BHD2 - BHD1; DBH 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,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,RPSTZ2,/ha,Census 2 - Factor of repreentation of each tree as per RPSTZ1
...@@ -23,4 +23,4 @@ use,var,units,description ...@@ -23,4 +23,4 @@ use,var,units,description
0,ALTERD2,yr,Census 2 - AGE of individual estimated from a model 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,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,WTYP1,,Census 1 - FOREST TYPE in 17 classes.
0,WTYP2,,Census 2 - FOREST TYPE in 17 classes. 0,WTYP2,,Census 2 - FOREST TYPE in 17 classes.
\ No newline at end of file
filename,sep,skip,contents
TRY_Proposal_177_DataRelease_2013_04_01.txt,t,0,
TRY_Proposal_177_DataRelease_2013_07_23.txt,t,0,
filename,sep,skip,contents
EcoregionCodes.csv,c,0,
FIA51_trees_w_supp.csv,c,0,
FIAspeciesCodes.csv,c,0,
FiaSpMaxHt.csv,c,0,
...@@ -17,8 +17,20 @@ ...@@ -17,8 +17,20 @@
"field methodology": "", "field methodology": "",
"trait information": "" "trait information": ""
}, },
"references": [ "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.",
"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":""}
}
} }
...@@ -3,7 +3,6 @@ ...@@ -3,7 +3,6 @@
opts_chunk$set(warnings = FALSE) opts_chunk$set(warnings = FALSE)
# LOAD SITE DETAILS # LOAD SITE DETAILS
files <- read.csv(file.path(DIR,"_file_index.csv"), stringsAsFactors=FALSE)
json_file <- file.path(DIR,"_site_details.JSON") json_file <- file.path(DIR,"_site_details.JSON")
details <- fromJSON(paste(readLines(json_file), collapse="")) details <- fromJSON(paste(readLines(json_file), collapse=""))
...@@ -51,14 +50,13 @@ Below is a list of the various files provided for this dataset, and the variable ...@@ -51,14 +50,13 @@ Below is a list of the various files provided for this dataset, and the variable
```{r,results="asis",echo=FALSE} ```{r,results="asis",echo=FALSE}
for(i in 1:length(files[,1])){ for(n in names(details$files)){
writeLines("\\newpage \n") 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)) mytext <- pandify(read.csv(filename, stringsAsFactors=FALSE))
writeLines(paste0("### ",files[i,"filename"],"\n")) writeLines(paste0("### ", n,"\n"))
writeLines(paste0(files[i,"contents"], "\n")) writeLines(paste0( details$files[[n]]$contents, "\n"))
writeLines(mytext) writeLines(mytext)
} }
``` ```
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment