The R Project SVN R

Rev

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

Rev 41391 Rev 41508
Line 91... Line 91...
91
\seealso{ \code{\link{setClass}}. }
91
\seealso{ \code{\link{setClass}}. }
92
 
92
 
93
\examples{
93
\examples{
94
setClass("track",
94
setClass("track",
95
          representation(x="numeric", y = "numeric"))
95
          representation(x="numeric", y = "numeric"))
96
t1 <- new("track", x=1:10, y=sort(rnorm(10)))
96
t1 <- new("track", x=1:10, y=sort(stats::rnorm(10)))
97
## A valid "track" object has the same number of x, y values
97
## A valid "track" object has the same number of x, y values
98
validTrackObject <- function(object) {
98
validTrackObject <- function(object) {
99
    if(length(object@x) == length(object@y)) TRUE
99
    if(length(object@x) == length(object@y)) TRUE
100
    else paste("Unequal x,y lengths: ", length(object@x), ", ",
100
    else paste("Unequal x,y lengths: ", length(object@x), ", ",
101
               length(object@y), sep="")
101
               length(object@y), sep="")