Could someone give me a hand with the format of the gsummary function? Basically, I have a large set of xyz coordinates generated by LiDAR data (>37 million points) and I am trying to derive various summary statistics on the z-coordinates by a grid cell. I wrote a function to do this by creating factors from the x- and y- coordinates and then using gsummary. However, I want the function to calculate BOTH the max z-value in a grid cell and the number of z-values in that cell. gsummary is supposed to be able to use a list a functions as input to FUN, but I am having trouble coding it correctly. Here is what I came up to so far.
gr<-gsummary(xyz.packet,FUN=list(numeric=max,numeric=length),omitGroupingFactor=T,form=~X/Y)
The help for the function gives no examples using multiple functions as a FUN value, so the help pages haven't been overly useful in this case.
Thanks in advance,
Mike
Mike R. Saunders
Forest Biometrician
Cooperative Forest Research Unit
University of Maine
5755 Nutting Hall
Orono, ME 04469-5755
207-581-2763 (O)
207-581-2833 (F)
[[alternative HTML version deleted]]