The R Project SVN R

Rev

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

Rev 47157 Rev 47916
Line 136... Line 136...
136
 
136
 
137
setClass("cdate", contains = "character", representation(date = "Date"))
137
setClass("cdate", contains = "character", representation(date = "Date"))
138
 
138
 
139
setClass("vdate", contains = "vector", representation(date = "Date"))
139
setClass("vdate", contains = "vector", representation(date = "Date"))
140
 
140
 
141
cd1 = new("cdate", "abcdef", date = Sys.Date())
141
cd1 <- new("cdate", "abcdef", date = Sys.Date())
142
 
142
 
143
cd2 = new("vdate", "abcdef", date = Sys.Date())
143
cd2 <- new("vdate", "abcdef", date = Sys.Date())
144
 
144
 
145
stopifnot(identical(cc(letters, character(), cd1), paste(letters, character(), cd1))) # the "character" method
145
stopifnot(identical(cc(letters, character(), cd1), paste(letters, character(), cd1))) # the "character" method
146
 
146
 
147
stopifnot(identical(cc(letters, character(), cd2), c(letters, character(), cd2))) # the default, because "vdate" doesn't extend "character"
147
stopifnot(identical(cc(letters, character(), cd2), c(letters, character(), cd2))) # the default, because "vdate" doesn't extend "character"
148
 
148