KernelMatrixAccessors {kebabs} | R Documentation |
KernelMatrix Accessors
## S4 method for signature 'KernelMatrix,index,missing,ANY' x[i] ## S4 method for signature 'matrix' as.KernelMatrix(x, center = FALSE)
x |
kernel matrix of class |
i |
numeric vector with indicies or character with element names |
center |
when set to |
see above
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
.
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
.
Johannes Palme <kebabs@bioinf.jku.at>
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.
## 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)