input dataframe (named df)
v1 v2 v3 #header
a_1 a_2 a_3
b_1 b_2 b_3
output
v1 v2 v3
a1 a2 a3
b1 b2 b3
I make custom function
my_fun <- function(x){
x<<-gsub("_","",x)}
but.. it is impossible
my_fun(df$v1)
my_fun(df$v2)
df does not change.
What's the problem with my code? Is there a good way to make a user-defined function?