[Rd] bug in fix & edit (PR#7642)
Prof Brian Ripley
ripley at stats.ox.ac.uk
Mon Feb 7 16:33:59 CET 2005
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 at 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 at 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
More information about the R-devel
mailing list