<html><head><style>body{font-family:Helvetica,Arial;font-size:13px}</style></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div id="bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px; color: rgba(0,0,0,1.0); margin: 0px; line-height: auto;">Already got the notification. Thanks Michael.</div><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_1402823787336809984" 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">Michael Smith</span> <a href="mailto:my.r.help@gmail.com">my.r.help@gmail.com</a><br>Reply: <span style="color:black">Michael Smith</span> <a href="mailto:my.r.help@gmail.com">my.r.help@gmail.com</a><br>Date: <span style="color:black">June 15, 2014 at 11:15:55 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">G See</span> <a href="mailto:gsee000@gmail.com">gsee000@gmail.com</a>, <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] `with=F` in the `i` Argument <br></span></div><br> <blockquote type="cite" class="clean_bq"><span><div><div></div><div>Hi Arun,
<br>
<br>Filed here:
<br>https://github.com/Rdatatable/data.table/issues/696
<br>
<br>Thanks,
<br>M
<br>
<br>On 06/15/2014 04:11 PM, Arunkumar Srinivasan wrote:
<br>> Michael,
<br>>
<br>> Thanks. Replacing |order| with |base:::order| seems to give the right
<br>> result. So, I’d say this is a case that seem to have escaped current
<br>> tests. So, yes, bug. Could you please file as one here
<br>> <https://github.com/Rdatatable/data.table/issues>?
<br>>
<br>>
<br>> Arun
<br>>
<br>> From: Michael Smith my.r.help@gmail.com <mailto:my.r.help@gmail.com>
<br>> Reply: Michael Smith my.r.help@gmail.com <mailto:my.r.help@gmail.com>
<br>> Date: June 15, 2014 at 5:02:46 AM
<br>> To: G See gsee000@gmail.com <mailto:gsee000@gmail.com>
<br>> Cc: datatable-help@lists.r-forge.r-project.org
<br>> datatable-help@lists.r-forge.r-project.org
<br>> <mailto:datatable-help@lists.r-forge.r-project.org>
<br>> Subject: Re: [datatable-help] `with=F` in the `i` Argument
<br>>
<br>>> Devs,
<br>>>
<br>>> Is this a bug? It works in 1.9.2 but not in the 1.9.3 development
<br>>> version:
<br>>>
<br>>> DT <- data.table(a = 1:4, b = 8:5)
<br>>> for (i in c("a", "b"))
<br>>> print(DT[order(DT[, i, with = FALSE])])
<br>>>
<br>>> Error in forder(DT, DT[, i, with = FALSE]) :
<br>>> Column '1' is type 'list' which is not supported for ordering currently.
<br>>>
<br>>>
<br>>> Thanks,
<br>>>
<br>>> M
<br>>>
<br>>>
<br>>> On 05/31/2014 12:44 PM, G See wrote:
<br>>> > Hi Michael,
<br>>> >
<br>>> > I would use get()
<br>>> >
<br>>> > DT <- data.table(a = 1:4, b = 8:5)
<br>>> > for (i in c("a", "b"))
<br>>> > print(DT[order(get(i))])
<br>>> >
<br>>> > For what it's worth, your solution doesn't seem to work in data.table
<br>>> > 1.9.3 (svn rev. 1278):
<br>>> >
<br>>> >> for (i in c("a", "b"))
<br>>> > + print(DT[order(DT[, i, with = FALSE])])
<br>>> > Error in forder(DT, DT[, i, with = FALSE]) :
<br>>> > Column '1' is type 'list' which is not supported for ordering currently.
<br>>> >
<br>>> >
<br>>> > HTH,
<br>>> > Garrett
<br>>> >
<br>>> > On Fri, May 30, 2014 at 11:01 PM, Michael Smith <my.r.help@gmail.com> wrote:
<br>>> >> All,
<br>>> >>
<br>>> >> I'm trying to order the rows according to several columns at a time:
<br>>> >>
<br>>> >> DT <- data.table(a = 1:4, b = 8:5)
<br>>> >> for (i in c("a", "b"))
<br>>> >> print(DT[order(i), with = FALSE])
<br>>> >>
<br>>> >> It doesn't work, since `with` seems to be about the `j` argument, but
<br>>> >> not the `i` argument, according to `?data.table`.
<br>>> >>
<br>>> >> I found the following workaround, but wonder whether there is a more
<br>>> >> elegant way to do it:
<br>>> >>
<br>>> >> for (i in c("a", "b"))
<br>>> >> print(DT[order(DT[, i, with = FALSE])])
<br>>> >>
<br>>> >> Thanks,
<br>>> >> M
<br>>> >> _______________________________________________
<br>>> >> datatable-help mailing list
<br>>> >> datatable-help@lists.r-forge.r-project.org
<br>>> >> https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/datatable-help
<br>>> _______________________________________________
<br>>> datatable-help mailing list
<br>>> datatable-help@lists.r-forge.r-project.org
<br>>> https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/datatable-help
<br>>>
<br>>
<br></div></div></span></blockquote></body></html>