R/method_initialize-CompactStratification.R

setMethod(
    f = "initialize",
    signature = signature(
        .Object = "CompactStratification"
    ),
    definition = function(.Object, cells, stratumId, centroids, mssd) {
        nCells <- nrow(coordinates(cells))
        if (nCells != length(stratumId)) {
            stop("length of 'stratumId' should match the number of cells", call. = FALSE)
        }
        .Object@cells <- cells
        .Object@stratumId <- stratumId
        .Object@centroids <- centroids
        .Object@mssd <- mssd
        .Object
    }
)

Try the spcosa package in your browser

Any scripts or data that you put into this service are public.

spcosa documentation built on April 11, 2023, 6:04 p.m.