Incomplete-class {softImpute} | R Documentation |
Class "Incomplete"
Description
a sparse matrix inheriting from class dgCMatrix
with the NAs
represented as zeros
Objects from the Class
Objects can be created by calls of the form
new("Incomplete", ...)
or by calling the function Incomplete
Slots
- i
Object of class
"integer"
- p
Object of class
"integer"
- Dim
Object of class
"integer"
- Dimnames
Object of class
"list"
- x
Object of class
"numeric"
- factors
Object of class
"list"
Methods
- as.matrix
signature(x = "Incomplete")
: ...- coerce
signature(from = "matrix", to = "Incomplete")
: ...- complete
signature(x = "Incomplete")
:...
Author(s)
Trevor Hastie and Rahul Mazumder
See Also
biScale
,softImpute
,Incomplete
,impute
,complete
Examples
showClass("Incomplete")
set.seed(101)
n=200
p=100
J=50
np=n*p
missfrac=0.3
x=matrix(rnorm(n*J),n,J)%*%matrix(rnorm(J*p),J,p)+matrix(rnorm(np),n,p)/5
ix=seq(np)
imiss=sample(ix,np*missfrac,replace=FALSE)
xna=x
xna[imiss]=NA
xnaC=as(xna,"Incomplete")
[Package softImpute version 1.4-3 Index]