slt {PSEA} | R Documentation

## Extracts from a list of objects

### Description

Simple wrapper to extract a particular slot for each object in a list.

### Usage

    slt(ls,slot,index=NULL)

### Arguments

`ls` | list of objects.
`slot` | character. Name of the slot to extract.
`index` | integer vector. Optional index vector to extract only a subset of the elements contained in the slot.

### Details

The slot to be extracted is defined by matching "slot" against slot names of the first object in the list.

Slot extraction is done with sapply and the format of the output will depend on the content of the slots (see the value returned by sapply for details).

### Value

`sc` | vector or matrix.

### Author(s)

Alexandre Kuhn alexandre.m.kuhn@gmail.com

### Examples

    ## Two arbitrary regression summaries in a list
    x<-1:10
    y1 <- x + rnorm(10,sd=1)
    y2 <- x + rnorm(10,sd=5)

    slm<-list()
    slm[[1]] <- summary(lm(y1 ~ x))
    slm[[2]] <- summary(lm(y2 ~ x))

    ## Extract R-squared from the list of summary.lm objects
    slt(slm, "adj.r.squared")

[Package PSEA version 1.26.0 Index]