[Rd] Assignment of individual values to data frame columns: intentional or unintentional behavior?

Ulrike Grömping groemping at bht-berlin.de
Thu Aug 5 18:24:09 CEST 2010


Dear developeRs,

I have just discovered a strange feature when assigning some values to 
columns of a data frame: The column is matched by partial matching (as 
documented), but when assigning a value, a new column with the partial 
name is added to the data frame that is identical to the original column 
except for the changed value. Is that intentional ? An example:

sw <- swiss[1:5, 1:4]
sw
sw$Fert[1] <- 10
sw

Best, Ulrike

-- 
***********************************************
* Ulrike Groemping                            *
* BHT Berlin - University of Applied Sciences *
***********************************************
* +49 (30) 39404863 (Home Office)             *
* +49 (30) 4504 5127 (BHT)                    *
***********************************************
* http://prof.beuth-hochschule.de/groemping         *
* groemping at bht-berlin.de                     *



More information about the R-devel mailing list