KernelMatrixAccessors {kebabs} | R Documentation

## KernelMatrix Accessors

### Description

KernelMatrix Accessors

### Usage

    ## S4 method for signature 'KernelMatrix,index,missing,ANY'
    x[i]

    ## S4 method for signature 'matrix'
    as.KernelMatrix(x, center = FALSE)

### Arguments

`x` | kernel matrix of class `KernelMatrix`
`i` | numeric vector with indicies or character with element names
`center` | when set to `TRUE` the matrix is centered. Default=FALSE

### Value

see above

### Accessor-like methods

  `x[i,]`: return a `KernelMatrix` object that only contains the rows selected with the subsetting parameter i. This parameter can be a numeric vector with indices or a character vector which is matched against the names of `x`.

  `x[,j]`: return a `KernelMatrix` object that only contains the columns selected with the subsetting parameter j. This parameter can be a numeric vector with indices or a character vector which is matched against the names of `x`.

  `x[i,j]`: return a `KernelMatrix` object that only contains the rows selected with the subsetting parameter i and columns selected by j. Both parameters can be a numeric vector with indices or a character vector which is matched against the names of `x`.

### Coercion methods

In the code snippets below, `x` is a kernel matrix.

  `as.KernelMatrix(x, center=FALSE)`: center the kernel matrix dependent on the center parameter and coerce it to class `KernelMatrix` .

### Author(s)

Johannes Palme <kebabs@bioinf.jku.at>

### References

http://www.bioinf.jku.at/software/kebabs
J. Palme, S. Hochreiter, and U. Bodenhofer (2015) KeBABS: an R package for kernel-based analysis of biological sequences. Bioinformatics, 31(15):2574-2576, 2015. DOI: 10.1093/bioinformatics/btv176.

### Examples

    ## create kernel object for normalized spectrum kernel
    specK5 <- spectrumKernel(k=5)
    ## Not run:
    ## load data
    data(TFBS)

    km <- specK5(enhancerFB)
    km1to5 <- km[1:5,1:5]
    km1to5

    ## End(Not run)

[Package kebabs version 1.18.0 Index]