From frederic.gosselin at cemagref.fr  Fri May 11 12:23:46 2007
From: frederic.gosselin at cemagref.fr (frederic.gosselin at cemagref.fr)
Date: Fri, 11 May 2007 12:23:46 +0200 (CEST)
Subject: [Rd] changing the mode of a factor (PR#9675)
Message-ID: <20070511102346.9FE7148F26@slim.kubism.ku.dk>

Full_Name: Fr?d?ric Gosselin
Version: 2.5 vs 2.4 and 2.2.1
OS: windows XP
Submission from: (NULL) (195.221.118.52)


#############
L3 <- LETTERS[1:3]
 (d <- data.frame(cbind(x=1, y=1:10), fac=as.factor(sample(L3, 10,
repl=TRUE))))
mode(d[,3])<-"numeric"
###############

when trying to change the mode of a column in a data.frame that is a factor to
numeric(cf. preceding code), the following error occurs (in French) in R 2.5:

Erreur dans `storage.mode<-`(`*tmp*`, value = "double") : 
        le mode de stockage d'un objet "factor" ne peut ?tre modifi?

The same thing works fine in R2.4 and 2.2.1. 

It does not seem to correspond to new things announced in the NEWS file for the
2.5 version...



[Rd] changing the mode of a factor (PR#9675)
frederic.gosselin at cemagref.fr