I have data.table with data that looks like this:
9: FIXED ASSETS
10: c("Tangible assets", "2", "726,809", "729,029")
11: c("Investments", "3", "2,020,888", "2,020,888")
I would like to extract the whole row of the data.table given the searching parameter:
search <- quote(ColName=="Tangible assets")
WholeRow <- subset(DT, eval(search))
or else, I have tried this:
DT[ColName=="Tangible assets"]
Where DT is name of the data.frame and ColName is the column name. There is only 1 column named ColName, where are all the data as seen.
How to extract the whole row with only partial search parameter?
listsomething like:DT[i=.., j=list(list(..))]. It might be worth taking a look at. - Ricardo Saporta