Note that there are some explanatory texts on larger screens.

plurals
  1. POunclear error/message: "Empty data.table (0 rows) of 1 col:"
    text
    copied!<p>can someone please shed some light on this error message (or just a message?).</p> <p>Sample code and output (I have <code>verbose=TRUE</code> but it does not seem to matter):</p> <p>Define the data.table:</p> <pre><code>DT &lt;- data.table(a=1:10, b=letters[1:2]) </code></pre> <p>This code works as expected:</p> <pre><code>DT[, a, by=b, verbose=TRUE] Finding groups (bysameorder=FALSE) ... done in 0secs. bysameorder=FALSE and o__ is length 10 Detected that j uses these columns: a Optimization is on but j left unchanged as 'a' Starting dogroups ... done dogroups in 0 secs b a 1: a 1 2: a 3 3: a 5 4: a 7 5: a 9 6: b 2 7: b 4 8: b 6 9: b 8 10: b 10 </code></pre> <p>This code seems to work but produces the message in the end, which I cannot comprehend:</p> <pre><code>DT[, cat("\nSome text"), by=b] Finding groups (bysameorder=FALSE) ... done in 0secs. bysameorder=FALSE and o__ is length 10 Detected that j uses these columns: &lt;none&gt; Optimization is on but j left unchanged as 'cat("\nSome text")' Starting dogroups ... Some text Some textdone dogroups in 0 secs Empty data.table (0 rows) of 1 col: b </code></pre> <p>Why is this <em>Empty data.table (0 rows) of 1 col:</em> message, and what is it telling me? There is no reference to <code>b</code> in <code>i</code> or <code>j</code>, and each row in the table does have a value for <code>b</code>. The code does seem to do what is requested, but I would prefer to understand if there is a problem before applying to my real dataset (which is several thousand rows and hence the result cannot be easily verified by hand).</p> <p>Setting a key for DT does not help.</p> <p>A quick check in google and here showed several cases with the same message but they do not seem relevant to this simple case (they all involve doing something with empty tables with 0 rows, or something in i and !NA's).</p> <p>Thanks!</p> <p>I am using the latest development version of data.table 1.8.9 from r-forge (All 985 tests in inst/tests/tests.Rraw completed ok).</p> <pre><code>R version 3.0.1 (2013-05-16) Platform: x86_64-w64-mingw32/x64 (64-bit) locale: [1] LC_COLLATE=English_United States.1252 LC_CTYPE=English_United States.1252 LC_MONETARY=English_United States.1252 LC_NUMERIC=C [5] LC_TIME=English_United States.1252 attached base packages: [1] grid stats graphics grDevices utils datasets methods base other attached packages: [1] bit64_0.9-2 bit_1.1-10 xts_0.9-5 zoo_1.7-10 nlme_3.1-110 hexbin_1.26.2 lattice_0.20-15 ggplot2_0.9.3.1 reshape_0.8.4 plyr_1.8 foreign_0.8-54 [12] data.table_1.8.9 loaded via a namespace (and not attached): [1] colorspace_1.2-2 dichromat_2.0-0 digest_0.6.3 gtable_0.1.2 labeling_0.2 MASS_7.3-27 munsell_0.4.2 proto_0.3-10 RColorBrewer_1.0-5 [10] reshape2_1.2.2 scales_0.2.3 stringr_0.6.2 tools_3.0.1 </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload