I would like to filter a `data.table` and then select the last row of that filtered `data.table` in a single command. The desired result from this command is a number as I am using the last row of that filtered expression in a formula. 

I would like to avoid defining a new variable where I filter the `data.table` and then select `.N` in another line.

Is this possible? 

Thank you!

```r
library(data.table)
library(magrittr)

# Sample data
dt <- data.table(style = c(rep("A", times = 10),
                           rep("B", times = 10)),
                 id = 1:20)

# Want to select last row when dt is filtered for style == "A"
5 * dt[style == "A" & .N, id]
#>  [1]  5 10 15 20 25 30 35 40 45 50

# Desired output is 50

# Want to avoid defining previously
a <- dt[style == "A"] %>% 
  .[.N, id]

5 * a
#> [1] 50

```

Created on 2019-03-15 by the [reprex package](https://reprex.tidyverse.org) (v0.2.1)