<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <div class="moz-cite-prefix"><br>
      Hi,<br>
      <br>
      This one isn't quite clear enough to answer quickly and easily.
      I'd expect there to be similar questions on Stack Overflow with
      code formatting, data in the question and benchmarks. Trick is how
      to filter the 708 data.table questions.<br>
      <br>
      Try these 61 returned by "[data.table] join two" :<br>
      <br>
      <meta http-equiv="content-type" content="text/html;
        charset=ISO-8859-1">
      <a
        href="http://stackoverflow.com/search?q=%5Bdata.table%5D+join+two">http://stackoverflow.com/search?q=%5Bdata.table%5D+join+two</a><br>
      <br>
      Let us know if that doesn't help,  or raise a new question there. 
      Also maybe try "[r] -[data.table] data.table"  with is:question or
      is:answer as well. That returns answers using data.table for
      questions which weren't about data.table.<br>
      <br>
      Matthew<br>
      <br>
      On 06/08/13 04:10, iembry wrote:<br>
    </div>
    <blockquote cite="mid:1375758602714-4673202.post@n4.nabble.com"
      type="cite">
      <pre wrap="">Hi, I started this new topic thread as now I'm concentrating on the
subsetting portion of the R code.

I have the R objects aimall and getratingsmore. aimall is a data.table with
the column names "mean" and "p50" and it is 59 rows long, but I have
truncated it for this question & getratingsmore is a list of 59 data.table
objects with the column names "y" and "x".

dput(aimall)
structure(list(mean = c(3882.65, 819.82, 23742.37), p50 = c(1830, 382,
10400)), .Names = c("mean", "p50"), row.names = c(NA, -3L), class =
c("data.table", "data.frame"), .internal.selfref = <pointer: 0x1a5c628>)


dput(getratingsmore)
list(structure(list(y = c(14.8, 14.81, 14.82), x = c(7900, 7920, 7930)),
.Names = c("y", "x"), row.names = c(NA, 
-2721L), class = c("data.table", "data.frame"), .internal.selfref =
<pointer: 0x1a5c628>), structure(list(y = c(4, 4.01, 4.02), x = c(21, 21,
22)), .Names = c("y", "x"), row.names = c(NA, -1464L), class =
c("data.table", "data.frame"), .internal.selfref = <pointer: 0x1a5c628>),
structure(list(y = c(73.05, 73.06, 73.07), x = c(70, 76, 82)), .Names =
c("y", "x"), row.names = c(NA, -1996L), class = c("data.table",
"data.frame"), .internal.selfref = <pointer: 0x1a5c628>))


I have used the following code to attempt to subset getratingsmore and the
dput follows:

mp <- lapply(seq_along(dailyvaluesneednew$site_no), function(u)
{ifelse(aim[1]$mean[u] < min(getratingsmore[[u]]$x), subset(getratings[[u]],
aim[1]$mean[u] > min(getratingsmore[[u]]$x) & aim[1]$mean[u], aim[u]$mean[u]
</pre>
      <blockquote type="cite">
        <pre wrap="">min(getratingsmore[[u]]$x)), aim[1]$mean[u])})
</pre>
      </blockquote>
      <pre wrap="">
dput(mp)
list(list(NULL), 819.82, 23742.37)


I had created a key for aimall, but then the data.table was sorted and it
lost its connection to getratingsmore. Right now, aimall and getratingsmore
represent the same station in their current order. 

Is there any way to set a key to each row of aimall that will match each
data.frame of getratingsmore?

Is there a way to subset in the way that I have described without a key
using data.table?

I want to know which stations have a mean and p50 value < the lowest "x" in
each station data.frame of getratingsmore so that those stations can then
use extrapolation in the next step.

I also want to know which stations ahve a mean and p50 value > the lowest
"x" in each station data.frame of getratingsmore so that those stations can
then use interpolation in the next step.

Thank you.

Irucka



--
View this message in context: <a class="moz-txt-link-freetext" href="http://r.789695.n4.nabble.com/subset-between-data-table-list-and-single-data-table-object-tp4673202.html">http://r.789695.n4.nabble.com/subset-between-data-table-list-and-single-data-table-object-tp4673202.html</a>
Sent from the datatable-help mailing list archive at Nabble.com.
_______________________________________________
datatable-help mailing list
<a class="moz-txt-link-abbreviated" href="mailto:datatable-help@lists.r-forge.r-project.org">datatable-help@lists.r-forge.r-project.org</a>
<a class="moz-txt-link-freetext" href="https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/datatable-help">https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/datatable-help</a>

</pre>
    </blockquote>
    <br>
  </body>
</html>