Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

Extract.pdMat

Subscript a pdMat Object


Description

This method function extracts sub-matrices from the positive-definite matrix represented by x.

Usage

## S3 method for class 'pdMat'
x[i, j, drop = TRUE]
## S3 replacement method for class 'pdMat'
x[i, j] <- value

Arguments

x

an object inheriting from class "pdMat" representing a positive-definite matrix.

i, j

optional subscripts applying respectively to the rows and columns of the positive-definite matrix represented by object. When i (j) is omitted, all rows (columns) are extracted.

drop

a logical value. If TRUE, single rows or columns are converted to vectors. If FALSE the returned value retains its matrix representation.

value

a vector, or matrix, with the replacement values for the relevant piece of the matrix represented by x.

Value

if i and j are identical, the returned value will be pdMat object with the same class as x. Otherwise, the returned value will be a matrix. In the case a single row (or column) is selected, the returned value may be converted to a vector, according to the rules above.

Author(s)

José Pinheiro and Douglas Bates bates@stat.wisc.edu

See Also

Examples

pd1 <- pdSymm(diag(3))
pd1[1, , drop = FALSE]
pd1[1:2, 1:2] <- 3 * diag(2)

nlme

Linear and Nonlinear Mixed Effects Models

v3.1-152
GPL (>= 2) | file LICENCE
Authors
José Pinheiro [aut] (S version), Douglas Bates [aut] (up to 2007), Saikat DebRoy [ctb] (up to 2002), Deepayan Sarkar [ctb] (up to 2005), EISPACK authors [ctb] (src/rs.f), Siem Heisterkamp [ctb] (Author fixed sigma), Bert Van Willigen [ctb] (Programmer fixed sigma), Johannes Ranke [ctb] (varConstProp()), R-core [aut, cre]
Initial release
2021-02-03

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.