User Tools

Site Tools


en:data:bci:script-soil

Script used to prepare BCI.soil data from the accessible Excel dataset

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')
 

Script used to create soil maps

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')
 

en/data/bci/script-soil.txt · Last modified: 2018/04/09 15:47 (external edit)