The R Project SVN R

Rev

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

Rev 59039 Rev 61168
Line 53... Line 53...
53
  \sQuote{\link{plotmath}} for the use of \code{union} and
53
  \sQuote{\link{plotmath}} for the use of \code{union} and
54
  \code{intersect} in plot annotation.
54
  \code{intersect} in plot annotation.
55
}
55
}
56
 
56
 
57
\examples{
57
\examples{
58
(x <- c(sort(sample(1:20, 9)),NA))
58
(x <- c(sort(sample(1:20, 9)), NA))
59
(y <- c(sort(sample(3:23, 7)),NA))
59
(y <- c(sort(sample(3:23, 7)), NA))
60
union(x, y)
60
union(x, y)
61
intersect(x, y)
61
intersect(x, y)
62
setdiff(x, y)
62
setdiff(x, y)
63
setdiff(y, x)
63
setdiff(y, x)
64
setequal(x, y)
64
setequal(x, y)
65
 
65
 
66
## True for all possible x & y :
66
## True for all possible x & y :
67
setequal( union(x,y),
67
setequal( union(x, y),
68
          c(setdiff(x,y), intersect(x,y), setdiff(y,x)))
68
          c(setdiff(x, y), intersect(x, y), setdiff(y, x)))
69
 
69
 
70
is.element(x, y)# length 10
70
is.element(x, y) # length 10
71
is.element(y, x)# length  8
71
is.element(y, x) # length  8
72
}
72
}
73
\keyword{misc}
73
\keyword{misc}