The R Project SVN R

Rev

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

Rev 46731 Rev 69903
Line 164... Line 164...
164
all(rank(x, na.last = NA) == na.omit(rxK))
164
all(rank(x, na.last = NA) == na.omit(rxK))
165
 
165
 
166
## as.list.function() instead of *.default():
166
## as.list.function() instead of *.default():
167
identical(as.list(as.list),
167
identical(as.list(as.list),
168
	  alist(x = , ... = , UseMethod("as.list")))
168
	  alist(x = , ... = , UseMethod("as.list")))
-
 
169
 
-
 
170
## startsWith() / endsWith()  assertions
-
 
171
t1 <- c("Foobar", "bla bla", "something", "another", "blu", "brown",
-
 
172
        "blau blüht der Enzian")# non-ASCII
-
 
173
t2 <- c("some text", "any text")
-
 
174
t3 <- c("Martin", "Zürich", "Mächler")
-
 
175
 
-
 
176
all(endsWith(t1, "")); all(startsWith(t1, ""))
-
 
177
all(endsWith(t2, "")); all(startsWith(t2, ""))
-
 
178
all(endsWith(t3, "")); all(startsWith(t3, ""))
-
 
179
all(endsWith(t2, "text"))
-
 
180
all(endsWith(t2, " text"))
-
 
181
identical(startsWith(t1, "b" ), c(FALSE, TRUE, FALSE, FALSE, TRUE,  TRUE, TRUE))
-
 
182
identical(startsWith(t1, "bl"), c(FALSE, TRUE, FALSE, FALSE, TRUE, FALSE, TRUE))
-
 
183
identical(startsWith(t1, "bla"),c(FALSE, TRUE, FALSE, FALSE,FALSE, FALSE, TRUE))
-
 
184
identical(  endsWith(t1, "n"),  c(FALSE,FALSE, FALSE, FALSE,FALSE,  TRUE, TRUE))
-
 
185
identical(  endsWith(t1, "an"), c(FALSE,FALSE, FALSE, FALSE,FALSE, FALSE, TRUE))
-
 
186
##
-
 
187
identical(startsWith(t3, "M" ), c( TRUE, FALSE, TRUE))
-
 
188
identical(startsWith(t3, "Ma"), c( TRUE, FALSE, FALSE))
-
 
189
identical(startsWith(t3, "Mä"), c(FALSE, FALSE, TRUE))
-
 
190