Introduction
Theory, R functions & Examples
The original Excel file was downloaded here and the second worksheet (means (20 X 20 m)) was saved as bci-soil-20x20.txt file and uploaded to this website. Further, the file was resampled into 1ha plots (i.e. values within 25 20×20 m plots have been averaged):
soil20x20 <- read.delim ('https://raw.githubusercontent.com/zdealveindy/anadat-r/master/data/bci-soil-20x20.txt') BCI.soil <- NULL for (x in seq (10, 990, by = 100)) for (y in seq (10, 490, by = 100)) BCI.soil <- rbind (BCI.soil, colMeans (soil20x20[soil20x20$x >= x & soil20x20$x < (x+100) & soil20x20$y >= y & soil20x20$y < (y+100),])) BCI.soil <- as.data.frame (BCI.soil) write.table (BCI.soil, file = 'BCI.soil.txt', sep = '\t')
soil20x20 <- read.delim ('https://raw.githubusercontent.com/zdealveindy/anadat-r/master/data/bci-soil-20x20.txt') filled.contour (matrix (soil20x20$pH, ncol = 25, byrow = T), color.palette = terrain.colors, main = 'pH') filled.contour (matrix (soil20x20$N, ncol = 25, byrow = T), color.palette = terrain.colors, main = 'Nitrogen')