[datatable-help] using lapply to subset mant data.tables

statquant3 statquant at outlook.com
Thu Feb 26 18:02:20 CET 2015


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.


More information about the datatable-help mailing list