Learn R Programming

MRIaggr (version 1.1.5)

selectN: Extract the number of observations

Description

Extract the number of observations contained in a Carto3D or in a MRIaggr object.

Usage

"selectN"(object, num = NULL) "selectN"(object, num = NULL, hemisphere = "both", subset = NULL)

Arguments

object
an object of class MRIaggr. REQUIRED.
num
the slices to consider. numeric vector or NULL.
hemisphere
the hemisphere to consider. character.
subset
the subset of observations to consider. positive integer vector or NULL leading to consider all observations.

Value

An integer.

Details

ARGUMENTS: Information about the num argument can be found in the details section of initNum.

Information about the hemisphere argument can be found in the details section of selectContrast.

FUNCTION: Each of the num, hemisphere and subset argument define a subset of the total set of observations. It is the length of the intersection of all these three subsets that is measured.

Examples

Run this code
## load a MRIaggr object
data("MRIaggr.Pat1_red", package = "MRIaggr")

## total number of observations
res <- selectN(MRIaggr.Pat1_red)

## number of observations for the hemisphere that contains the lesion
res <- selectN(MRIaggr.Pat1_red, hemisphere = "lesion")

## number of observations in the first 1000 observations t
## that are in the hemisphere containing the lesion
res <- selectN(MRIaggr.Pat1_red, subset = 1:1000, hemisphere = "lesion")

Run the code above in your browser using DataLab