ConstructSampleFactors: Construct model matrix for integrating multiple samples

Description Usage Arguments Value

View source: R/stat-methods.R


Given the output of the function BindSPE we would like to control for biases introduced by binning all the data together. ConstructSampleFactors takes the output of BindSPE and returns a model matrix of factors highlighting what sample a given cell is from


ConstructSampleFactors(XY, sample.ids, intercept = TRUE)



An X-Y-sizes list - the output of BindSPE


The IDs of the samples that have been bound together - for naming the factors


If true an intercept is modelled when calling the function model.matrix but then removed from the resulting matrix so it isn't modelled twice when lm is later called. If false, the call to model.matrix is performed without an intercept, and the resulting model.matrix contains all sample factors - this matrix will have one more column that if intercept = FALSE.


A model matrix that correctly accounts for differing means of samples as the result of binding them together using the function BindSPE.

kieranrcampbell/SpatialStats documentation built on May 18, 2017, 7:44 p.m.