This report documents the construction of the header file for sPlot 3.0. It is based on dataset sPlot_3.0.2, received on 24/07/2019 from Stephan Hennekens.
```{r results="hide", message=F, warning=F}
knitr::opts_chunk$set(echo = TRUE)
library(tidyverse)
library(readr)
## Spatial packages
library(sp)
library(rgdal)
library(rgeos)
library(raster)
library(rworldmap)
```
```{bash, eval=F}
# escape all double quotation marks. Run in Linux terminal
sed 's/"/\\"/g' sPlot_3_0_2_header.csv > sPlot_3_0_2_header_test.csv
#more general alternative in case some " are already escaped
##first removing \s before all "s, and then adding \ before all ":
##only works because the two plots have identical coords
mutate(Longitude=replace(Longitude,
list=PlotObservationID %in% (new.coords %>%
pull(PlotObservationID)),
values=new.coords %>% pull(Longitude)))%>%
mutate(Latitude=replace(Latitude,
list=PlotObservationID %in% (new.coords %>%
pull(PlotObservationID)),
values=new.coords %>% pull(Latitude)))
rm(new.coords)
```
There are `r nrow(header %>% filter(is.na(`Location uncertainty (m)`)))`. As a first approximation, we assign the median of the respective dataset, as a negative value, to indicate this is an estimation, rather than a measure.