Chapter 9 Reporting results
The GSNmap consists of a set of mandatory and optional maps that are to be generated as raster files (GeoTiff) at a resolution of 250 x 250 m and at the mandatory depth of 0-30 cm.
The Mandatory data products are:
- total N
- available P
- available K
- CEC
- soil pH
- clay, silt, and sand
- soil organic carbon concentration
- bulk density
Additionally, maps at deeper depths 30-60 cm and/or about micronutrients such as Ca, S, Mg, Fe, B, Cl, Mn, Zn, Cu, Mo, and Ni can be provided. All layers need to be submitted with the corresponding standard deviation layers.
An Rmarkdown script (with the extension .Rmd) is provided in the folder National Report. Script 5 can be used to translate the rmarkdown file into an automated report as a Word docx file.
#_______________________________________________________________________________
#
# QA/QC
# Soil Property Mapping
#
# GSP-Secretariat
# Contact: Isabel.Luotto@fao.org
# Marcos.Angelini@fao.org
#_______________________________________________________________________________
#Empty environment and cache
rm(list = ls())
gc()
# Content of this script =======================================================
# 0 - Setup and user-defined variables
# 1 - User-defined variables
# 2 - Render the .Rmd file to generate an automated report as a docx
#_______________________________________________________________________________
# 0 - Initial Setup ============================================================
#install.packages("rmarkdown")
#tinytex::install_tinytex()
# library(sf)
# library(ggplot2)
# library(tidyverse)
# library(terra)
library(knitr)
# library(tidyterra)
# library(patchwork)
# Working directory
setwd(dirname(rstudioapi::getActiveDocumentContext()$path))
setwd("..")
# 1 - User-defined variables ==================================================
# Specify three-digit ISO code for your country
<- 'AOI'
ISO
# Specify the properties you mapped (the code assumes harmonized naming)
# using the output data frame from script 2
<- read.csv("02-Outputs/harmonized_soil_data.csv")
dxy
<- names(dxy)[ !(names(dxy)%in% c("ProfID", "x" ,"y"))]
target_properties
#target_properties<-c('ph_0_30')
# Map background file
<-vect('01-Data/AOI.shp')
bckg
#Adjust figure width and height of the map plot
<- 12
figw <-8
figh
# Specify where you want your word document to be saved
= paste0("National Report/Report_GSNmap_",ISO,".docx")
output_file
# 2 - Render the .Rmd file to generate an automated report as a docx ===========
= 'National Report/National GSNmap Report.Rmd'
path = 'word_document'
output_format ::render(path, output_format, output_file) rmarkdown
The output report document is to be submitted along with the layers using a submission form provided by the GSP Secretariat.