say I have 3 data.tables

set.seed(1)
DT1 = data.table(x=c(1L,1L,2L),y=rnorm(3))
DT2 = data.table(x=c(1L,2L,2L),y=rnorm(3))
DT3 = data.table(x=c(2L,2L,1L),y=rnorm(3))

DTList = list(DT1,DT2,DT3)

I'd like to apply the i expression "x==1L" to all 3 DTs
I tried several approaches with lapply like:

lapply(DTList, FUN=subset, select=quote(x==1L))
lapply(DTList, FUN=subset, select=x==1L)

None works, is there a smart DT way to do this (my DTs are in a list)

Cheers



--
View this message in context: 
http://r.789695.n4.nabble.com/using-lapply-to-subset-mant-data-tables-tp4703898.html
Sent from the datatable-help mailing list archive at Nabble.com.
_______________________________________________
datatable-help mailing list
[email protected]
https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/datatable-help

Reply via email to