The PROFOUND sites

knitr::opts_chunk$set(fig.width=10, fig.height=10, warning=FALSE, cache = F)
set.seed(1)
library(pander)
panderOptions('table.alignment.default', function(df)
    ifelse(sapply(df, is.numeric), 'right', 'left'))
panderOptions('table.split.table', Inf)
#panderOptions('big.mark', ",")
panderOptions('keep.trailing.zeros', TRUE)
#set.alignment('left', row.names = 'right')

tableCaption <- local({
  tableid <- 0
  function(x=NULL){
    if(is.null(x)){
      return(tableid)
    }else{
      tableid <<- tableid + 1
      paste("Table ", tableid, ": ", x , sep = "")  
    }
  }
})

figCaption <- local({
  figureid <- 0
  function(x) {
    figureid <<- figureid + 1
    paste('Figure ', figureid, ': ', x, sep = '')
  }
})

subsectionNumbering <- local({
  sectionid <- 0
  function(x, y) {
    sectionid <<- sectionid + 1
    paste('## ', y, ".", sectionid, '. ', x, "\n\n", sep = '')
  }
})

library(knitr)
library(plyr)

set.seed(1)
library(ProfoundData)
setDB(params$myDB)
description <- getData("SITEDESCRIPTION")
df <- browseData("POLICY")
df <- df[!df$dataset == "PROFOUND database" , ]
df <- df[!df$dataset == "CLIMATEFLUXNET" , ]
rownames(df) <- NULL

Site overview

df <- getData(dataset = "SITES")
df <- df[, !colnames(df) %in% c("natVegetation_code1" , "natVegetation_code2" , "natVegetation_description")]
df <- df[!df$site_id ==99, ]

r paste( "The PROFOUND database includes ", nrow(df), " forest sites. They are listed in the table below.", sep = "")

pander(df, adding = 0, missing = '**--**', round = 3, use.hyphening = TRUE, split.cells = 3, split.tables = 200,
        caption = tableCaption("Forest sites included in the database."))

To provide the information on which data is available for each site, an overview table is created by combining all existing tables in the database.

overview <- browseData()
pander(overview, adding = 0, missing = '**--**', round = 3, use.hyphening = TRUE, split.cells = 3, split.tables =  Inf,
        caption = tableCaption("Overview of sites and datasets"))
out <- NULL

for (i in 1:length(overview$site_id)) {
  currentSiteID <- overview$site_id[i]
  currentSiteID <- overview$site_id[i]
  currentSiteName <- overview$site[i]
  currentDescription <- description[description$site ==currentSiteName, ]$description
 out <- c(out, knit_child(system.file("rmd", "ChildSiteSummary.Rmd", package = "ProfoundData")))
}

r paste(out, collapse='\n')

References

df <- getData("SITEDESCRIPTION")
reference <- paste(df$reference, collapse = " ")
reference <- unlist(strsplit(reference, split = "[+]"))
reference <- reference[-1]
reference <- sort(reference, decreasing = FALSE)
reference <- reference[!duplicated(reference)]
reference <- paste("\n +", reference)

r paste(reference, collapse="")



Try the ProfoundData package in your browser

Any scripts or data that you put into this service are public.

ProfoundData documentation built on March 31, 2020, 5:24 p.m.