[R-sig-Geo] questions on spatial interpolation exercise(NL)
Mengxi Yang
m.yang at student.utwente.nl
Sun Nov 23 23:51:58 CET 2014
Dear list,
I have a question on write.table. I found an nice exercise on spatial
interpolation from
http://spatial-analyst.net/wiki/index.php?title=Spatial_interpolation_exercises_(NL)#Spatial_prediction_of_daily_precipitation_in_the_Netherlands
In this exercise, the date is 200906. but when I change to 201310. there is
a wrong message like:
> tmp <- readLines(paste(getwd(), "/", "monv_201310.txt", sep=""))
> tmp <- gsub(pattern=' . ', replacement=' 0.0 ', tmp, fixed = TRUE)
> tmp <- gsub(pattern='[[:space:]]{2,7}', replacement=',', tmp)
> write.table(t(matrix(unlist(strsplit(tmp, ",")[-c(1:8)]), nrow=41)),
"tmp.txt", col.names=FALSE, row.names=FALSE)
Warning message:
In matrix(unlist(strsplit(tmp, ",")[-c(1:8)]), nrow = 41) :
data length [13625] is not a sub-multiple or multiple of the number of
rows [41]
I checked several month, some success but some not.
Does anyone know what is the wrong with it? should I change something?
Thank you very much.
Mengxi Yang
[[alternative HTML version deleted]]
More information about the R-sig-Geo
mailing list