Dear all, Here is an issue I often stumble on. 1- colunm types in data.frames. -------------------------------
d <- data.frame(x=as.character(c("a", "b", "c")), y=as.numeric(c(1, 2, 3)))
d
x y 1 a 1 2 b 2 3 c 3
is.numeric(d[1,2])
[1] TRUE
is.numeric(d[1,1])
[1] FALSE
apply(d, c(1,2), is.numeric)
x y 1 FALSE FALSE 2 FALSE FALSE 3 FALSE FALSE
------------------------------- All item in column "y" should be TRUE right? What should I do to apply a function only to numerics in d? (beside using nested 'for' loops) Thanks for your help, and for all the great software. Vincent Detours