data(iris)

# iris3 is first 3 rows of iris

iris3 <- iris[1:3,]

# iris3 is first 3 rows of iris

iris3 <- iris[1:3,]

computed

z <- c(F,F,F)

for(i in seq(z)) z[i] <- identical(iris3[1,],iris3[i,])

z

[1] TRUE FALSE FALSEfor(i in seq(z)) z[i] <- identical(iris3[1,],iris3[i,])

z

# this should do the same but is incorrect

apply(iris3,1,function(x)identical(x,iris3[1,]))

1 2 3FALSE FALSE FALSE

What's wrong here?

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-

r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html

Send "info", "help", or "[un]subscribe"

(in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch

_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._