Skip to content
Prev 22033 / 29559 Next

questions on spatial interpolation exercise(NL)

On 25-11-2014 21:41, Mengxi Yang wrote:
Janurary has 31 days hence you need to adjust the number of rows in that 
table:

 > tmp <- readLines(paste(getwd(), "/", "monv_201301.txt", sep=""))
 > tmp <- gsub(pattern=' . ', replacement=' 0.0 ', tmp, fixed = TRUE)
 > tmp <- gsub(pattern='[[:space:]]{2,7}', replacement=',', tmp)
 > tmp[8]
[1] "# 
NR,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,I,NORM,II,NORM,III,NORM,MND,NORM"
 > write.table(t(matrix(unlist(strsplit(tmp, ",")[-c(1:8)]), nrow=42)), 
"tmp.txt", col.names=FALSE, row.names=FALSE)
 > monv_201301 <- read.table("tmp.txt", col.names=c("empty1", "NR", 
paste("D", 1:31, sep=""), "I", "NORM", "II", "NORM", "III", "NORM", 
"MND", "NORM", "Locatie"))
 > monv_201301$empty1 <- NULL
 > monv_201301$Locatie <- as.factor(gsub(pattern='[[:space:]]+$', 
replacement='', monv_201301$Locatie))
 > str(monv_201301)
'data.frame':   325 obs. of  41 variables:
  $ NR     : int  760 458 680 572 89 664 678 560 910 441 ...
  $ D1     : num  7.2 17.2 10 9.6 12 11.9 10.2 14.3 13.6 15.5 ...
  $ D2     : num  0.4 2.8 4.7 2.7 3.2 4.5 3 2.8 0.8 3.2 ...
  $ D3     : num  0.9 0.9 1.7 0.5 0.5 1.4 1 0.5 0.9 0.2 ...
...

 From here on you can continue running the code from 
http://spatial-analyst.net/wiki/index.php?title=Spatial_interpolation_exercises_(NL)
You need to download some long term rainfall map (climatic) for January 
(I've used the one from http://worldclim.org/current) and then resample 
it to the Dutch projection system. I am sure if you search a bit you can 
find even more up-to-date maps of long term precipitation (climatic 
images) for Europe.

all the best with your work,

T. Hengl