The R Project SVN R

Rev

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

Rev 52030 Rev 58136
Line 17... Line 17...
17
stopifnot(identical(cc, as(xyc, "complex")))
17
stopifnot(identical(cc, as(xyc, "complex")))
18
as(xyc, "complex") <- cc * 1i
18
as(xyc, "complex") <- cc * 1i
19
stopifnot(identical(xyc, new("xy", x = -y1, y = x1)))
19
stopifnot(identical(xyc, new("xy", x = -y1, y = x1)))
20
 
20
 
21
setGeneric("size", function(x)standardGeneric("size"))
21
setGeneric("size", function(x)standardGeneric("size"))
-
 
22
## check that generic for size() was created w/o a default method
-
 
23
stopifnot(is(size, "standardGeneric"),
-
 
24
          is.null(selectMethod("size", "ANY",optional=TRUE)))
22
 
25
 
23
setMethod("size", "vector", function(x)length(x))
26
setMethod("size", "vector", function(x)length(x))
24
 
27
 
25
## class "xy" should inherit the vector method through complex
28
## class "xy" should inherit the vector method through complex
26
stopifnot(identical(size(xyc), length(x1)))
29
stopifnot(identical(size(xyc), length(x1)))