From ripley at stats.ox.ac.uk  Mon Feb  7 16:33:59 2005
From: ripley at stats.ox.ac.uk (Prof Brian Ripley)
Date: Mon Feb  7 16:34:17 2005
Subject: [Rd] bug in fix & edit (PR#7642)
In-Reply-To: <20050203155524.D4138E0B9@slim.kubism.ku.dk>
References: <20050203155524.D4138E0B9@slim.kubism.ku.dk>
Message-ID: <Pine.LNX.4.61.0502071523001.30765@gannet.stats>

What exactly is supposed to be the bug here?  Despite the requests in the 
posting guide and FAQ, there is nothing to reproduce here, and

> xx <- data.frame(a="a", b=I("b"))
> sapply(xx, is.character)
     a     b
FALSE  TRUE
> fix(xx) # do nothing
> sapply(xx, is.character)
     a     b
FALSE  TRUE

shows that your claim is false, at least in current R 2.0.1 (and you have 
failed to give your or your system details as requested -- do see the 
function bug.report).

My guess is that you do not have character columns protected by I(), and 
if so you should expect them to be coerced to factors quite arbitrarily.
That is what I() is for ....

On Thu, 3 Feb 2005 roberts@berkeley.edu wrote:

> The edit command (and the fix command, which calls edit), when used on 
> data frames, cause a character variable to become a factor variable. 
> Here is an example:
>
>>> is.factor(work$notes)
>> [1] FALSE
>>> is.character(work$notes)
>> [1] TRUE
>>> fix(work)
>>> is.character(work$notes)
>> [1] FALSE
>>> is.factor(work$notes)
>> [1] TRUE
>
> in this example, no editing was done -- the data frame work was not 
> changed by the user.

-- 
Brian D. Ripley,                  ripley@stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595


[Rd] bug in fix & edit (PR#7642)
Prof Brian Ripley