SCM

SCM Repository

[matrix] Diff of /pkg/man/sparseVector-class.Rd
ViewVC logotype

Diff of /pkg/man/sparseVector-class.Rd

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 2206, Wed Jun 25 14:57:02 2008 UTC revision 2207, Mon Jul 7 22:34:52 2008 UTC
# Line 39  Line 39 
39  \alias{as.numeric,sparseVector-method}  \alias{as.numeric,sparseVector-method}
40  \alias{as.vector,sparseVector,missing-method}  \alias{as.vector,sparseVector,missing-method}
41  \alias{as.vector,sparseVector,character-method}  \alias{as.vector,sparseVector,character-method}
42    \alias{dim<-,sparseVector-method}
43  \alias{length,sparseVector-method}  \alias{length,sparseVector-method}
44    \alias{rep,sparseVector-method}
45  \alias{show,sparseVector-method}  \alias{show,sparseVector-method}
46  %  %
47  \alias{[,sparseVector,index,ANY,ANY-method}  \alias{[,sparseVector,index,ANY,ANY-method}
# Line 84  Line 86 
86        entries of large sparse vectors are printed at all.}        entries of large sparse vectors are printed at all.}
87      \item{as.vector}{\code{signature(x = "sparseVector", mode = "character")}      \item{as.vector}{\code{signature(x = "sparseVector", mode = "character")}
88        coerces sparse vectors to \dQuote{regular}, i.e., atomic vectors.        coerces sparse vectors to \dQuote{regular}, i.e., atomic vectors.
89        This is the same as \code{as(x, "vector")}.        This is the same as \code{as(x, "vector")}.}
90      }      \item{dim<-}{\code{signature(x = "sparseVector", value = "integer")}
91          coerces a sparse vector to a sparse Matrix, i.e., an object
92          inheriting from \code{\linkS4class{sparseMatrix}}, of the
93          appropriate dimension.}
94        \item{rep}{\code{signature(x = "sparseVector")} repeat \code{x},
95          with the same argument list \code{(x, times, length.out, each,
96          ...)} as the default method for rep().}
97    }    }
98  }  }
99  %\author{Martin}  %\author{Martin}
100  \examples{  \examples{
101  showClass("sparseVector")  getClass("sparseVector")
102  showClass("dsparseVector")  getClass("dsparseVector")
103  showClass("xsparseVector")# those with an 'x' slot  getClass("xsparseVector")# those with an 'x' slot
104    
105  sx <- c(0,0,3, 3.2, 0,0,0,-3:1,0,0,2,0,0,5,0,0)  sx <- c(0,0,3, 3.2, 0,0,0,-3:1,0,0,2,0,0,5,0,0)
106  (ss <- as(sx, "sparseVector"))  (ss <- as(sx, "sparseVector"))
107    
108  ix <- as.integer(round(sx))  ix <- as.integer(round(sx))
109  (is <- as(ix, "sparseVector"))  (is <- as(ix, "sparseVector"))
110  %% FIXME: I'd want  isparseVector  ## an "isparseVector" (!)
 %%  
 as(is, "isparseVector") %% ERROR ## FIXME  
111    
112  %% FIXME: Explain and show  spV2M() or its successor  ## rep() works too:
113    rep(is, length.out= 25)
114    
115    ## Using `dim<-`  as in base R :
116    r <- ss
117    dim(r) <- c(4,5) # becomes a sparse Matrix:
118    r
119    
120  }  }
121  \keyword{classes}  \keyword{classes}

Legend:
Removed from v.2206  
changed lines
  Added in v.2207

root@r-forge.r-project.org
ViewVC Help
Powered by ViewVC 1.0.0  
Thanks to:
Vienna University of Economics and Business Powered By FusionForge