knitr::opts_chunk$set(echo = TRUE)

R Markdown

This is an R Markdown document. Markdown is a simple formatting syntax for authoring HTML, PDF, and MS Word documents. For more details on using R Markdown see http://rmarkdown.rstudio.com.

When you click the Knit button a document will be generated that includes both content as well as the output of any embedded R code chunks within the document. You can embed an R code chunk like this:

#data <- retrieve_VST_data(site = "OSBS", start = 2019)

Including Plots

You can also embed plots, for example:

plots <- data$vst_perplotperyear %>% 
  filter(siteID %in% c("HARV", "DSNY", "SCBI", "SERC", "JERC", #not available for 2018
                       "GUAN", "STEI", "UNDE", "KONZ",
                       "UKFS", "GRSM", "MLBS", "ORNL",
                       "DELA", "LENO", "TALL", "DCFS",
                       "WOOD", "STER", "CLBJ", "OAES",
                       "MOAB", "NIWO", "JORN", "WREF", 
                       "SJER", "SOAP", "TOOL", "DEJU", "PUUM")) %>%
  dplyr::filter(treesPresent == "Y") %>%
  dplyr::select(plotID, siteID, easting, northing, utmZone)
aop_retriever(plots, years=2018,
       products=c("DP3.30010.001"))

Note that the echo = FALSE parameter was added to the code chunk to prevent printing of the R code that generated the plot.

crop_data_to_plot(dtprd=c( "DP3.30006.001","DP3.30015.001", 
          "DP3.30024.001", "DP3.30025.001"), plots, bff=22)

crop_data_to_plot(dtprd="DP3.30010.001", plots, bff=220)

Same pipeline should be working by using the traits data

data <- sf::read_sf("~/Documents/Data/Chapter3/field_data/cfc_field_data.shp") %>% data.frame
plots <- data %>% 
  filter(siteID %in% c("HARV", "DSNY", "SCBI", "SERC", "JERC",
                       "GUAN", "STEI", "UNDE", "KONZ",
                       "UKFS", "GRSM", "MLBS", "ORNL",
                       "DELA", "LENO", "TALL", "DCFS",
                       "WOOD", "STER", "CLBJ", "OAES",
                       "MOAB", "NIWO", "JORN", "WREF", 
                       "SJER", "SOAP", "TOOL", "DEJU", "PUUM")) %>%
    dplyr::select(plotID, siteID, easting, northng, ap_tmZn, cllctDt)
#beware to have all columns following NEON data structure
colnames(plots) <- c("plotID",  "siteID",  "easting", "northing", "utmZone", "cllctDt")
aop_retriever(plots, years=plots[["cllctDt"]],
       products=c("DP3.30010.001"))


vscholl/neonVstAop documentation built on Sept. 9, 2021, 3:11 p.m.