search for: siteclim

Displaying 1 result from an estimated 1 matches for "siteclim".

Did you mean: iterlim
2009 Nov 17
0
Re place NA values in matrix with the value of Nearest Neighbour
...e("xy_.txt")) sq<-xy[,1] x<-xy[,2] y<-xy[,3] xy<-cbind(x,y) xy<-xy/5000 xy<- xy+41 xy<- cbind(xy[,2],xy[,1]) nfiles=2 for( imap in 2:nfiles) { print(fnames[imap]) x = as.matrix(read.table(fnames[imap],skip=6)) x[x = -99999] = NA x=flipud(x) siteclim <- x[ xy] } This all works fine, however as many of the sites are so close to the sea, many NA's are returned, as teh climate information has not been extrapolated to include detailed coastal areas. Thus i would like to know how i can modify my script to instruct R to replace the NA value...