Learn R Programming

BigDataStatMeth (version 2.0.3)

eigen: Spectral decomposition

Description

Overrides base::eigen() to dispatch on HDF5Matrix objects. For plain R matrices the call is forwarded to base::eigen().

Usage

eigen(x, symmetric, ...)

# S3 method for default eigen( x, symmetric = !isSymmetric(x), only.values = FALSE, EISPACK = FALSE, ... )

# S3 method for HDF5Matrix eigen(x, symmetric = TRUE, ...)

Value

For HDF5Matrix: a named list with elements values (numeric vector), vectors

(HDF5Matrix or NULL), values_imag, and is_symmetric. For other objects: the result of base::eigen().

Arguments

x

An HDF5Matrix or any R object accepted by base::eigen().

symmetric

Logical. Whether to assume x is symmetric. Passed to base::eigen() for plain R objects.

...

For HDF5Matrix: named arguments forwarded to x$eigen()k (integer, number of eigenvalues), which (character, "LM"/"SM"/etc.), compute_vectors (logical), tolerance (numeric), max_iter (integer), overwrite (logical), threads (integer). Ignored for eigen.default.

only.values

Logical. Ignored; present for compatibility with base::eigen.

EISPACK

Logical. Ignored; present for compatibility with base::eigen.

See Also

svd.HDF5Matrix, prcomp.HDF5Matrix

Examples

Run this code
# \donttest{
tmp <- tempfile(fileext = ".h5")
m   <- crossprod(matrix(rnorm(400), 20, 20))
X   <- hdf5_create_matrix(tmp, "data/M", data = m)
ev  <- eigen(X, symmetric = TRUE, k = 5L)
ev$values
close(ev$vectors)
close(X)
unlink(tmp)
# }

Run the code above in your browser using DataLab