<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><p>Hi Amy,</p>
<p>Good to know that it’s not reproducible in 1.9.3. Matt already fixed it.</p>
<p><code>X[Y, LHS := RHS]</code> can not exceed <code>nrow(X)</code> because this assignment is made <em>by reference</em>. If the join from <code>X[Y]</code> results in more than <code>nrow(X)</code>, then <code>X</code> will be to be re-allocated entirely.</p>
<p>If you only want those that match with <code>X</code>, then you should do: <code>X[Y, female := i.female, nomatch=0L]</code>.</p>
<p>If instead you want all the rows from <code>y</code>, then you could do: <code>x[y, allow.cartesian=TRUE]</code>.</p>
<p><style>body{font-family:Helvetica,Arial;font-size:13px}</style><style>body {
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
padding:1em;
margin:auto;
background:#fefefe;
}
h1, h2, h3, h4, h5, h6 {
font-weight: bold;
}
h1 {
color: #000000;
font-size: 28pt;
}
h2 {
border-bottom: 1px solid #CCCCCC;
color: #000000;
font-size: 24px;
}
h3 {
font-size: 18px;
}
h4 {
font-size: 16px;
}
h5 {
font-size: 14px;
}
h6 {
color: #777777;
background-color: inherit;
font-size: 14px;
}
hr {
height: 0.2em;
border: 0;
color: #CCCCCC;
background-color: #CCCCCC;
}
p, blockquote, ul, ol, dl, li, table, pre {
margin: 15px 0;
}
a, a:visited {
color: #4183C4;
background-color: inherit;
text-decoration: none;
}
#message {
border-radius: 6px;
border: 1px solid #ccc;
display:block;
width:100%;
height:60px;
margin:6px 0px;
}
button, #ws {
font-size: 12 pt;
padding: 4px 6px;
border-radius: 5px;
border: 1px solid #bbb;
background-color: #eee;
}
code, pre, #ws, #message {
font-family: Monaco;
font-size: 10pt;
border-radius: 3px;
background-color: #F8F8F8;
color: inherit;
}
code {
border: 1px solid #EAEAEA;
margin: 0 2px;
padding: 0 5px;
}
pre {
border: 1px solid #CCCCCC;
overflow: auto;
padding: 4px 8px;
}
pre > code {
border: 0;
margin: 0;
padding: 0;
}
#ws { background-color: #f8f8f8; }
table {
border-collapse: collapse;
font-family: Helvetica, arial, freesans, clean, sans-serif;
color: rgb(51, 51, 51);
font-size: 15px; line-height: 25px;
padding: 0; }
table tr {
border-top: 1px solid #cccccc;
background-color: white;
margin: 0;
padding: 0; }
table tr:nth-child(2n) {
background-color: #f8f8f8; }
table tr th {
font-weight: bold;
border: 1px solid #cccccc;
margin: 0;
padding: 6px 13px; }
table tr td {
border: 1px solid #cccccc;
margin: 0;
padding: 6px 13px; }
table tr th :first-child, table tr td :first-child {
margin-top: 0; }
table tr th :last-child, table tr td :last-child {
margin-bottom: 0; }
.send { color:#77bb77; }
.server { color:#7799bb; }
.error { color:#AA0000; }</style></p><div id="bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px; color: rgba(0,0,0,1.0); margin: 0px; line-height: auto;"><br></div> <div id="bloop_sign_1403226415605540864" class="bloop_sign"><div style="font-family:helvetica,arial;font-size:13px">Arun</div></div> <div style="color:black"><br>From: <span style="color:black">Amy</span> <a href="mailto:mathematical.coffee@gmail.com">mathematical.coffee@gmail.com</a><br>Reply: <span style="color:black">Amy</span> <a href="mailto:mathematical.coffee@gmail.com">mathematical.coffee@gmail.com</a><br>Date: <span style="color:black">June 20, 2014 at 3:01:50 AM</span><br>To: <span style="color:black">Arunkumar Srinivasan</span> <a href="mailto:aragorn168b@gmail.com">aragorn168b@gmail.com</a><br>Cc: <span style="color:black">datatable-help@lists.r-forge.r-project.org</span> <a href="mailto:datatable-help@lists.r-forge.r-project.org">datatable-help@lists.r-forge.r-project.org</a><br>Subject: <span style="color:black"> Re: [datatable-help] What is going on with R 3.1 ? <br></span></div><br> <blockquote type="cite" class="clean_bq"><span><div><div></div><div>
<title></title>
<div dir="ltr">Hi Arun,
<div><br></div>
<div>In 1.9.3 I get the "Error in vecseq(f__, len__, if
(allow.cartesian) NULL else as.integer(max(nrow(x), : Join results
in 33 rows; more than 28 = max(nrow(x),nrow(i))...." message and it
doesn't assign the column (upon `x[y, female:=female]`, so no, the
error doesn't occur.</div>
<div><br></div>
<div>But as an aside, shouldn't it this command work?</div>
<div>If I have x with subjects a, a, b, c, d; y with genders for
subjects a--f, shouldn't x[y, female:=female] copy the female
column from y to x, duplicating as necessary?</div>
<div>Of course y[x] produces the table I'm after, but in the case
that y has extra columns I /don't/ want in the output and x has
extra columns I /do/, `y[x]` is then not the table I'm after. (But
now we are straying into a different question, my limited
understanding of how to use data.table, as opposed to the bug this
thread is about).</div>
<div><br></div>
<div>PS - typo on the data.table Readmein the "if you get latex
errors during installation" bit:</div>
<div><br></div>
<div>devtools:::install_github("datat.able", ...)</div>
<div><br></div>
<div>"datat.able" --> "data.table".</div>
<div><br></div>
<div>cheers</div>
<div>Amy</div>
</div>
<div class="gmail_extra"><br>
<br>
<div class="gmail_quote">On 20 June 2014 10:51, Arunkumar
Srinivasan <span dir="ltr"><<a href="mailto:aragorn168b@gmail.com" target="_blank">aragorn168b@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div style="word-wrap:break-word">
<p>Hi,</p>
<p>Could you let us know if you’re able to reproduce it in the
<a href="https://github.com/Rdatatable/data.table" target="_blank">devel version 1.9.3</a> as well?</p>
<div style="font-family:Helvetica,Arial;font-size:13px;color:rgba(0,0,0,1.0);margin:0px;line-height:auto">
<br></div>
<div style="font-family:Helvetica,Arial;font-size:13px;color:rgba(0,0,0,1.0);margin:0px;line-height:auto">
<br></div>
<div>
<div style="font-family:helvetica,arial;font-size:13px">Arun</div>
</div>
<div style="color:black"><br>
From: <span style="color:black">mathematical.coffee</span>
<a href="mailto:mathematical.coffee@gmail.com" target="_blank">mathematical.coffee@gmail.com</a><br>
Reply: <span style="color:black">mathematical.coffee</span>
<a href="mailto:mathematical.coffee@gmail.com" target="_blank">mathematical.coffee@gmail.com</a><br>
Date: <span style="color:black">June 20, 2014 at 2:44:50
AM</span><br>
To: <span style="color:black"><a href="mailto:datatable-help@lists.r-forge.r-project.org" target="_blank">datatable-help@lists.r-forge.r-project.org</a></span>
<a href="mailto:datatable-help@lists.r-forge.r-project.org" target="_blank">datatable-help@lists.r-forge.r-project.org</a><br>
Subject: <span style="color:black">Re: [datatable-help] What
is going on with R 3.1 ?<br></span></div>
<br>
<blockquote type="cite">
<div>
<div><span>Hi all,<br>
<br>
Sorry to resurrect an old thread, but I've been experiencing these
problems<br>
too and have come up with a reproducible example (for me
anyway).<br>
<br>
Data.table 1.9.2, R 3.1.0<br>
<br>
I was trying to join some tables and got the usual "rerun
with<br>
allow.cartesian=TRUE" message like Michele, and then got this
error:<br>
<br>
Error in if (!is.null(lhs)) { : missing value where TRUE/FALSE
needed<br>
<br>
However while I was trying to strip down my data to reproduce the
error, I<br>
now consistently get this one instead:<br>
<br>
Error in `[.data.table`(x, y, `:=`(female, female)) :<br>
object 'bysubl' not found<br>
<br>
<br>
rather than the TRUE/FALSE one. But they seem to be related.<br>
<br>
* x has a column of subjects, some duplicated<br>
* y has a column of subjects, none duplicated, and some not present
in x<br>
(all subjects of x are in y though).<br>
* y additionally has a binary column `female` that I wish to join
into x<br>
<br>
(I know there are other ways to do this, but this is a stripped
down example<br>
and seems to point out something going wrong in data.table so it is
just an<br>
illustrative example):<br>
<br>
```<br>
library(data.table)<br>
x=fread('x.csv')<br>
y=fread('y.csv')<br>
setkey(x, subject)<br>
setkey(y, subject)<br>
<br>
x[y]<br>
# Error in vecseq(f__, len__, if (allow.cartesian) NULL else<br>
as.integer(max(nrow(x), :<br>
# Join results in 33 rows; more than 28 = max(nrow(x),nrow(i)).
Check for<br>
duplicate key values in i, each of which join to the same group in
x over<br>
and over again. If that's ok, try including `j` and dropping
`by`<br>
(by-without-by) so that j runs for each group to avoid the large
allocation.<br>
If you are sure you wish to proceed, rerun with
allow.cartesian=TRUE.<br>
Otherwise, please search for this error message in the FAQ, Wiki,
Stack<br>
Overflow and datatable-help for advice.<br>
<br>
x[y, female:=female]<br>
Error in `[.data.table`(x, y, `:=`(female, female)) :<br>
object 'bysubl' not found<br>
```<br>
<br>
I get the above reproducibly with this dataset.<br>
<br>
From now onwards, if I type in 'x' or 'y' into the prompt I get
nothing<br>
printed at all. Additionally:<br>
<br>
```<br>
tables()<br>
# Error in gettext(domain, unlist(args)) : invalid 'string'
value<br>
# Error: argument "finally" is missing, with no default<br>
```<br>
<br>
The only solution is to restart the R session.<br>
<br>
Note: this *doesn't* occur if the column I try to merge (`female`
in this<br>
case) is continuous, for example. I can only get it if it's
logical.<br>
<br>
I've attached x.csv and y.csv to this email for you to play
with.<br>
<br>
I think it might be possible to strip down the tables to less rows
(x has<br>
28, y has 26) but in my (not exhaustive) attempts to do so, I
didn't get<br>
this particular error.<br>
<br>
x.csv <<a href="http://r.789695.n4.nabble.com/file/n4692401/x.csv" target="_blank">http://r.789695.n4.nabble.com/file/n4692401/x.csv</a>><br>
y.csv <<a href="http://r.789695.n4.nabble.com/file/n4692401/y.csv" target="_blank">http://r.789695.n4.nabble.com/file/n4692401/y.csv</a>><br>
<br>
<br>
<span class="HOEnZb"><font color="#888888"><br>
--<br>
View this message in context: <a href="http://r.789695.n4.nabble.com/What-is-going-on-with-R-3-1-tp4689002p4692401.html" target="_blank">http://r.789695.n4.nabble.com/What-is-going-on-with-R-3-1-tp4689002p4692401.html</a><br>
Sent from the datatable-help mailing list archive at
Nabble.com.<br>
_______________________________________________<br>
datatable-help mailing list<br>
<a href="mailto:datatable-help@lists.r-forge.r-project.org" target="_blank">datatable-help@lists.r-forge.r-project.org</a><br>
<a href="https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/datatable-help" target="_blank">https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/datatable-help</a><br>
</font></span></span></div>
</div>
</blockquote>
</div>
</blockquote>
</div>
<br></div>
</div></div></span></blockquote><p></p></body></html>