I can't be sure without seeing a sample of your data, more detail on what you're trying to accomplish, and the packages you've loaded, but maybe the options below will be helpful.
Are you trying to operate on just the
v2elffelrbin column? If so, then maybe the following:
mutate(v2elffelrbin = replace(v2elffelrbin, v2elffelrbin < 0, NA_real_))
Or with the
naniar package (which is overkill if you only want to operate on a single column),
replace_with_na_at(.vars = c("v2elffelrbin"),
condition = ~ .x < 0)
If you want to replace values that are less than zero in any column:
replace_with_na_all(condition = ~ .x < 0)
I think what's going wrong with your code (assuming you're using
replace_with_an_all from the
naniar package) is that
replace_with_na_all doesn't take a specific column name in the formula argument, but instead uses
.x as a "pronoun" to represent each of the columns in the data frame.