From louisept at pweh.com  Thu Mar 13 23:19:40 2003
From: louisept at pweh.com (louisept@pweh.com)
Date: Thu Mar 13 23:19:59 2003
Subject: [Rd] The function 'apply' (PR#2633)
Message-ID: <200303132219.h2DMJen9003276@pubhealth.ku.dk>

Full_Name: Paul Louisell
Version: 1.6.2
OS: Windows NT
Submission from: (NULL) (192.249.47.9)


I've found a problem with either the 'apply' or 'is.factor' functions, and it
seems like it might be cause for concern. Here are the commands taken directly
from the R session:

> is.factor(test.frame[, 1])
[1] TRUE
> is.factor(test.frame[, 2])
[1] TRUE
> is.factor(test.frame[, 3])
[1] TRUE
> is.factor(test.frame[, 4])
[1] TRUE
> apply(test.frame, 2, is.factor)
   X1    X2    X3    X4 
FALSE FALSE FALSE FALSE 


All of the variables in test.frame are factors, and is.factor returns TRUE when
it's used on each factor individually. When it's used inside of apply, all of
the variables return the value FALSE. So there's something wrong in at least one
of these functions.


[Rd] The function 'apply' (PR#2633)
louisept@pweh.com