HH (version 3.1-25)

diag.maybe.null: Returns a value for the diagonal of NA and NULL arguments.

Description

Returns the argument for the diagonal of NA and NULL arguments. For all other arguments, it calls the regular diag function.

Usage

diag.maybe.null(x, ...)

Arguments

x
matrix, vector, NA,
...
Other arguments to diag.

See Also

#ifndef S-Plus diag. #endif #ifdef S-Plus diag. #endif

Examples

Run this code
diag.maybe.null(NULL)
diag.maybe.null(NA)
diag.maybe.null(1:5)

Run the code above in your browser using DataCamp Workspace