# sumofsquares: sumofsquares In GriegSmith: Uses Grieg-Smith method on 2 dimentional spatial data

## Description

Used by GriegSmith function

## Usage

 `1` ```sumofsquares(sizematrix, singlecounts) ```

## Arguments

 `sizematrix` `singlecounts`

## Examples

 ``` 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``` ```## The function is currently defined as function(sizematrix,singlecounts){ # print(sizematrix); xsublength<-sizematrix[1]; ysublength<-sizematrix[2]; xsize<-length(singlecounts[1,]); ysize<-length(singlecounts[,1]); xmin<-rep(seq(from=1,to=xsize,by=xsublength),ysize/ysublength); ymin<-sort(rep(seq(from=1,to=ysize,by=ysublength),xsize/xsublength)); submatricies<-cbind(xmin,ymin); squaredsums<-sum(apply(submatricies,1,addem,data=singlecounts,xmatlen=xsublength,ymatlen=ysublength)); # print(squaredsums); ## sum up all the numbers in each matrix, square those numbers and add them; } ```

GriegSmith documentation built on May 2, 2019, 12:07 p.m.