The R Project SVN R-packages

Rev

Rev 4440 | Rev 4501 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 4440 Rev 4483
Line 310... Line 310...
310
				value = "replValue"),
310
				value = "replValue"),
311
		 replSPvec)
311
		 replSPvec)
312
 
312
 
313
 
313
 
314
 
314
 
315
## a "method" for c(<sparseVector>, <sparseVector>):
315
## a "method" for c(<(sparse)Vector>, <(sparse)Vector>):
316
c2v <- function(x, y) {
316
c2v <- function(x, y) {
317
    cx <- class(x)
-
 
318
    cy <- class(y)
317
    ## these as(., "sp..V..") check input implicitly:
319
    stopifnot(extends(cx, "sparseVector"),
318
    cx <- class(x <- as(x, "sparseVector"))
320
              extends(cy, "sparseVector"))
319
    cy <- class(y <- as(y, "sparseVector"))
321
    if(cx != cy) { ## find "common" class; result does have 'x' slot
320
    if(cx != cy) { ## find "common" class; result does have 'x' slot
322
        cxy <- c(cx,cy)
321
        cxy <- c(cx,cy)
323
        commType <- {
322
        commType <- {
324
            if(all(cxy %in% c("nsparseVector", "lsparseVector")))
323
            if(all(cxy %in% c("nsparseVector", "lsparseVector")))
325
                "lsparseVector"
324
                "lsparseVector"