The R Project SVN R

Rev

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

Rev 25033 Rev 39252
Line 1... Line 1...
1
 
1
 
2
R : Copyright 2003, The R Development Core Team
2
R version 2.5.0 Under development (unstable) (2006-09-11 r39251)
3
Version 1.8.0 Under development (unstable) (2003-07-02)
3
Copyright (C) 2006 The R Foundation for Statistical Computing
-
 
4
ISBN 3-900051-07-0
4
 
5
 
5
R is free software and comes with ABSOLUTELY NO WARRANTY.
6
R is free software and comes with ABSOLUTELY NO WARRANTY.
6
You are welcome to redistribute it under certain conditions.
7
You are welcome to redistribute it under certain conditions.
7
Type `license()' or `licence()' for distribution details.
8
Type 'license()' or 'licence()' for distribution details.
8
 
9
 
9
R is a collaborative project with many contributors.
10
R is a collaborative project with many contributors.
10
Type `contributors()' for more information.
11
Type 'contributors()' for more information and
-
 
12
'citation()' on how to cite R or R packages in publications.
11
 
13
 
12
Type `demo()' for some demos, `help()' for on-line help, or
14
Type 'demo()' for some demos, 'help()' for on-line help, or
13
`help.start()' for a HTML browser interface to help.
15
'help.start()' for an HTML browser interface to help.
14
Type `q()' to quit R.
16
Type 'q()' to quit R.
15
 
17
 
16
> #### Testing  UseMethod() and even more NextMethod()
18
> #### Testing  UseMethod() and even more NextMethod()
17
> ####
19
> ####
18
> 
20
> 
19
> ###-- Group methods
21
> ###-- Group methods
Line 32... Line 34...
32
> y <- 4:2 ; class(y) <- c("bar", "foo")
34
> y <- 4:2 ; class(y) <- c("bar", "foo")
33
> 
35
> 
34
> ## The next 4 give a warning each about incompatible methods:
36
> ## The next 4 give a warning each about incompatible methods:
35
> x > y
37
> x > y
36
[1] FALSE FALSE  TRUE
38
[1] FALSE FALSE  TRUE
37
Warning message: 
39
Warning message:
38
Incompatible methods (">.foo", ">.bar") for ">" 
40
Incompatible methods (">.foo", ">.bar") for ">" 
39
> y < x # should be the same (warning msg not, however)
41
> y < x # should be the same (warning msg not, however)
40
[1] FALSE FALSE  TRUE
42
[1] FALSE FALSE  TRUE
41
Warning message: 
43
Warning message:
42
Incompatible methods ("Ops.bar", "Ops.foo") for "<" 
44
Incompatible methods ("Ops.bar", "Ops.foo") for "<" 
43
> x == y
45
> x == y
44
[1] FALSE  TRUE FALSE
46
[1] FALSE  TRUE FALSE
45
Warning message: 
47
Warning message:
46
Incompatible methods ("Ops.foo", "Ops.bar") for "==" 
48
Incompatible methods ("Ops.foo", "Ops.bar") for "==" 
47
> x <= y
49
> x <= y
48
[1]  TRUE  TRUE FALSE
50
[1]  TRUE  TRUE FALSE
49
Warning message: 
51
Warning message:
50
Incompatible methods ("Ops.foo", "Ops.bar") for "<=" 
52
Incompatible methods ("Ops.foo", "Ops.bar") for "<=" 
51
> 
53
> 
52
> x > 3 ##[1] ">.foo"
54
> x > 3 ##[1] ">.foo"
53
[1] ">.foo"
55
[1] ">.foo"
54
> 
56
> 
Line 88... Line 90...
88
> abc(e1)
90
> abc(e1)
89
abc: Before dispatching; x has class `expression':  expression(sin(x))
91
abc: Before dispatching; x has class `expression':  expression(sin(x))
90
'expression' method of abc: abc.expression(e1) 
92
'expression' method of abc: abc.expression(e1) 
91
> abc(e0[[1]])
93
> abc(e0[[1]])
92
abc: Before dispatching; x has class `(': language, mode "(": (x)
94
abc: Before dispatching; x has class `(': language, mode "(": (x)
93
'(' method of abc: "abc.("(e0[[1]]) 
95
'(' method of abc: `abc.(`(e0[[1]]) 
94
> abc(e1[[1]])
96
> abc(e1[[1]])
95
abc: Before dispatching; x has class `call': language sin(x)
97
abc: Before dispatching; x has class `call': language sin(x)
96
abc.default(e1[[1]])
98
abc.default(e1[[1]])
97
> 
99
>