<table cellspacing="0" cellpadding="0" border="0"><tr><td valign="top"><div id='yahoo__compose_area' style="background-color:white; display:block; font-family:HelveticaNeue-Regular,Helvetica;"><div><br></div><div>Lets say we have two data.tables X and Y. Both are keyed. If we do a join operation like this:</div><div><br></div><div>X<-Y[X]</div><div><br></div><div>then X seems to lose it's key. In other words, key(X) returns NULL. Why is this? I am having to use setkey() after every  join operation which seems inefficient. I tried merge() and that seems to maintain the key. I could just use merge but I wanted to see if others experience the same behaviour with join and if there is a design reason for this. Thank you.</div><div><br></div><br><br><br><a href="https://yho.com/footer0">Sent from Yahoo Mail for iPhone</a></div><div id='yahoo__original_message'></div></html></td></tr></table>