Skip to contents

Returns a logical matrix of the same dimensions as X. Here TRUE means the value in X is observed (non-missing), and FALSE means it is an existing NA. This is different from the mask returned by make_missing_splits(), where TRUE means a cell was not artificially held out and can include cells that were already NA. Combine that split mask with !is.na(X) to identify observed training cells.

Usage

mask_missing(X)

Arguments

X

numeric matrix (species x traits or species x latent columns).

Value

Logical matrix, TRUE = observed (non-missing) in X.

Examples

X <- matrix(c(1, NA, 3, 4), nrow = 2)
mask_missing(X)
#>       [,1] [,2]
#> [1,]  TRUE TRUE
#> [2,] FALSE TRUE