New to R - do not know how to use If

Thanks a lot.
I tried the == (had it before as well) but get this error message
Error in if (sales$EndUser == "B") { :
missing value where TRUE/FALSE needed
In addition: Warning message:
In if (sales$EndUser == "B") { :
the condition has length > 1 and only the first element will be used

I first used the if else statement, and made else empty ("").
However, when I would then run the second line (I have a whole list - for instance "CC" needs to become "C", else emply --> it would overwrite my first command.