[datatable-help] No error message when trying to use a column which doesn't exist

Vivianne Vilar viviannevilar at gmail.com
Mon Jul 2 19:35:06 CEST 2012


Hi there,

I have just installed the new version of data.table and used the "fresh"
function combining *:= in j *with *by*, and I am very happy with it. So
first I want to thank the maintainers/developers for the library and the
new function.

The main reason for my email, though, is the following: I had a variable
called results62. I created a column of NAs called LAGMKTCAP and
subsequently tried to change the values of this column using

results62[,LAGMKTCAP :=
results62$MKTCAP[match(results62$PM,results62$TM)],by=PERMNO]

without having created the column TM beforehand. I received the output from
R of the head and tail of my object results62, as expected, but the column
LAGMKTCAP hadn't been changed. Only later did I realise I had forgotten to
create the column TM.

Wouldn't it be desirable to return an error when trying to use a column of
the data.table object which doesn't yet exist? Is this normal behaviour or
a bug?



Vivianne
----------------------------------------------
“Don't worry about the world coming to an end today. It is already tomorrow
in Australia.”
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.r-forge.r-project.org/pipermail/datatable-help/attachments/20120702/edd6224f/attachment.html>


More information about the datatable-help mailing list