[Rd] changing the mode of a factor (PR#9675)

From: <frederic.gosselin_at_cemagref.fr>
Date: Fri, 11 May 2007 12:23:46 +0200 (CEST)


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...



R-devel_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel Received on Fri 11 May 2007 - 20:11:51 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Fri 11 May 2007 - 21:34:27 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-devel. Please read the posting guide before posting to the list.