I am not trying to solve any particular problem, but trying to learn R and understand its logical negation operator \"!\" documented on page http://stat.ethz.ch/R-manual/R-d
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:
> !x
Error in !x : invalid argument type
Hence, the correct solutions try to change this step.
So: Always check your innermost statements when an errors occurs and work yourself outwards.