it might be due to R or dplyr version difference, but I got a different error/set of errors.
Error: unexpected '=' in:
" df=df %>%
mutate({{x}}="
> na.omit({{x}}) %>%
+ distinct({{x}}, .keep_all=TRUE)
Error in na.omit({ : object 'x' not found
>
> return(df)
Error: no function to return from, jumping to top level
> }
Error: unexpected '}' in "}"
The first of which relates to not being able to mutate things to dynamic names with the normal = operator, a colon-equals operator would be needed
drop_dupes=function(df, x){
df=df %>%
mutate({{x}}:=str_to_lower({{x}})) %>%
na.omit({{x}}) %>%
distinct({{x}}, .keep_all=TRUE)
return(df)
}
Error: unexpected '=' in: