# NOT RUN {
library(fields) # for easy grid construction
data(catchcan)
use.data<-catchcan$lateral #matrix can be viewed as plan view of catch data
#x,y matrix 10 ft x 10 ft catch can spacing
x<-seq(-35,25,10) # x=0 is lateral position
y<-seq(55,5,-10) #plan view top to bottom
grd<-list(x,y) # prepare list for make.surface function [fields]
grid<-make.surface.grid(grd)
plot(grid)
labels<-matrix(t(use.data),ncol=1)#transpose matrix and stack rows into 1 column
text(grid[ ,1],grid[ ,2],labels,cex=0.8,pos=1) # plot catch data at collection point
## or plot using function plotss. Shows test data from 1 lateral with no overlap.
cdata<-cbind(grid[ ,1],grid[ ,2],labels) #construct required catch can data matrix
sp.x<-rep(0,3);sp.y<-seq(60,0,-30)# sprinkler spacing (y) = 30 ft, plot top to bottom
sploc<-cbind(sp.x,sp.y) #construct required sprinkler location matrix
plotss(cdata,sploc)
# }
# NOT RUN {
<!-- %% maybe str(catchcan) ; plot(catchcan) ... -->
# }
Run the code above in your browser using DataLab