It works for me when used in combination with =, in expressions such as:

1 != 2
TRUE

But I can't quite comprehend standalone application of this operator. For instance, can I use it to select elements of the list which do not have specific name. Here's my attempt to do that, but it did not work:

where names(l) %in% x returns a boolean vector along the names of the list l indicating whether they are contained in x or not. Finally, I avoided the use of list as a variable, since you can see it is a fairly common function as well.

First, I think the ! in != is not the ! operator. It is a distinct, != operator, which means "different from".

Second, the ! operator is a logical one, the logical negation, and it must be applied to a logical vector :

R> !(c(TRUE,FALSE))
[1] FALSE TRUE

As numbers can be coerced to logical, it can also be applied to a numerical vector. In this case 0 will be considered as FALSE and any other value as TRUE :

R> !c(1,0,-2.5)
[1] FALSE TRUE FALSE

In your example, you are trying to apply this logical operator to a character string, which raises an error.

If you want to subset lists, data frames or vectors by names, indices or conditions, you should read and learn about the indexing part of the R language, which is described in the R manuals and most of the introductory books and documents.

I agree with everything said by the other two posters, but want to add one more thing I always tell when teaching R.

R works in that it evaluates statements from the inside to the outside and each of those statements needs to run on it's own. If you already have an error in an inner statement, no wonder the outers do not produce anything.

In your case one could say you have two statements: !x and list accessing on list via [.

If you replicate R's behavior you notice that !x already produces the error: