Skip to content
Prev 326636 / 398502 Next

replacement functions for subsets

On Jul 10, 2013, at 12:17 PM, Harry Mamaysky wrote:

            
I'm not sure how you decide that was happening. Your first paragraph seemed correct:

aa <- data.frame( a=1:10,b=101:110 )
str(aa)
attributes(aa)
dput(aa)
`rownames<-`
trace: `rownames<-`(`*tmp*`, value = c("1", "row2", "row3", "row4", 
"5", "6", "7", "8", "9", "10"))

You can see that R first builds a full length vector with the second argumens to `rownames<-` fully expanded before doing the assignment to the 'row.names' attribute.
Take a look at the code:

`row.names<-.data.frame`