Displaying 1 result from an estimated 1 matches for "cbinddfwunits".
2008 Apr 04
0
Loosing attributes while binding data frames ...
...uot;)
attr(df2,"units")
df2
df3 <- cbind(df1,df2)
df3
attr(df3,"units")
-------------CODE END-----------------------
The last line returns NULL. So I got my two data frames nicely bound
in a third, but I lost my units along the way. I can easily write my
own function "cbinddfwunits" to bind the data frames with the units,
but I am curious as what are the rules that govern this unexpected R
behaviour. I would definitely expect that if the two objects have
similar properties, then these properties should not be lost during
object manipulation, but R proves me wrong ... If...