It seems to be generally considered poor programming practise to use variable names that have functions in base R with the same name.
For example, it is tempting to
I agree with @Gavin Simpson and @Nick Sabbe that there is not really a problem, but that this is more a question of readability of code. Hence, as much things in life, it is a question of convention and consensus.
And I think it is a good convention to give the general advice: Do not name your variables like base R functions!
This advice works like other good advices. For example, we all know that we shall not drink too much booze and do not eat too much unhealthy food, but from time to time we cannot follow these advices and get drunk while eating too much junk food.
The same is true for this advice. It does obviously make sense to name the data argument data. But it makes a lot less sense to name a data vector mean. Although there may be situations in which even this seems appropriate. But try to avoid those situations for clarity.