MRIaggr-allocW: Allocate a neighbourhood matrix

Description Usage Arguments Details Value See Also Examples

Description

Allocate a neighbourhood matrix to a MRIaggr object.

Usage

1
2
3
## S4 replacement method for signature 'MRIaggr'
allocW(object, type, 
         overwrite = FALSE, verbose = optionsMRIaggr("verbose")) <- value

Arguments

object

an object of class MRIaggr. REQUIRED.

value

a list containing the neighbourhood matrix and associated elements. list. See the details section. REQUIRED.

type

the type of element to be allocated. Can be "Wmatrix", "Wblocks" or "upper". REQUIRED.

overwrite

if an element with the same name is already stored in object@ls_descStats, can it be overwritten ? logical.

verbose

should the execution of the function be traced ? logical.

Details

ARGUMENTS:
Argument value must be a list containing named elements :

FUNCTION:
This method enable to store a neighbourhood matrix (type="Wmatrix"), a block decomposition of the matrix (type="Wblocks") and its format (type="upper") : entire matrix (NULL), upper-triagonal (TRUE) or lower-triagonal (FALSE).

Value

None.

See Also

calcW to compute the neighboring matrix.
calcBlockW to decompose the neighboring matrix in independant blocks.
selectW to extract the neighboring matrix or its related elements.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
## load a MRIaggr object
data("MRIaggr.Pat1_red", package = "MRIaggr")

## search for a neighbourhood matrix
# selectW(MRIaggr.Pat1_red) # no neighbourhood matrix

## compute the neighbourhood matrix
resW <- calcW(object = MRIaggr.Pat1_red, range = sqrt(2))

## store it
allocW(MRIaggr.Pat1_red, type = "Wmatrix") <- list(Wmatrix = resW$W)

## it is automatically performed when specifying update.object = TRUE
calcW(object = MRIaggr.Pat1_red, range = sqrt(2), update.object = TRUE, overwrite = TRUE)

bozenne/MRIaggr documentation built on May 13, 2019, 1:39 a.m.