Changed setKey to use assign() instead of <<-

I would like some feedback if the environment used is the right if i put
this in a package