Skip to content
Prev 360390 / 398503 Next

assign color to subsets

'grepl' returns a logical vector; you have to use this to get your subset.
You can use:

df_tq <- subset(df, grepl("t1", Command))
df_t2 <- subset(df, grepl("t2", Command))

# if you want to also get a subset that has both, use

df_both <- subset(df, grepl("t1", Command) & grepl("t2", Command))




Jim Holtman
Data Munger Guru

What is the problem that you are trying to solve?
Tell me what you want to do, not how you want to do it.
On Sun, Apr 24, 2016 at 2:36 PM, <chalabi.elahe at yahoo.de> wrote: