Q:

Accessing items in a list using R, combining after split and apply

I'm just getting started in the process of cleaning up strings with R and have learned a ton thus far.   The portion of the current project that I'm stuck on is (I think) largely related to referencing values in a list.  I'm trying the split-apply-combine approach and am having trouble getting back to the form of the data I want at the end. 
I've tried various permutations of which(), unlist(), and any() but just can't seem to get what I'm looking for - so here I sit, asking for your help.   Thanks. 
I have a long list of strings...
> dput(x) 

list(c("ACETATE", "RINGERS"), "ACETYLCYSTEINE", c("ACETYLSALICYLIC", 
"ACID"), "ADIRAMYCIN", c("ADRENALINE", "00003901"), "ALEMTUZUMAB")

> x

[[1]]
[1] "ACETATE" "RINGERS"

[[2]]
[1] "ACETYLCYSTEINE"

[[3]]
[1] "ACETYLSALICYLIC" "ACID"           

[[4]]
[1] "ADIRAMYCIN"

[[5]]
[1] "ADRENALINE" "00003901"  

[[6]]
[1] "ALEMTUZUMAB"

I've written the simple code to remove specific words from list...
bad.words <- c("ACID", "BASE", "HYDROCHOLIRDE", "STUFF")
a <- lapply(x, function(x) x %in% bad.words) 

> a

[[1]]
[1] FALSE FALSE

[[2]]
[1] FALSE

[[3]]
[1] FALSE  TRUE

[[4]]
[1] FALSE

[[5]]
[1] FALSE FALSE

[[6]]
[1] FALSE

I would like to be able to create z so that it is x without the bad.words. 
> z

[[1]]
[1] "ACETATE" "RINGERS"

[[2]]
[1] "ACETYLCYSTEINE"

[[3]]
[1] "ACETYLSALICYLIC"           

[[4]]
[1] "ADIRAMYCIN"

[[5]]
[1] "ADRENALINE" "00003901"  

[[6]]
[1] "ALEMTUZUMAB"

A:

You were almost there:
lapply(x, function(z) z[! ( z %in% bad.words)])

Alternatively, you could do
lapply(x, function(z) setdiff(z,bad.words))

which seems more elegant to me.