Hi
I have this df
df <- tribble(~Name, ~Color,
'car', 'green',
'bus','red',
'train','black',
'ship','red',
'bus','red',
'car','black',
'ship','green',
'car','black',
'bus','black',
'train','red',
'car','green',
'bus','green',
'ship', 'red',
'bus', 'green',
'train','red')
and I have this function
gsub( pattern, "", x )
How can I apply the gsub function to column Color
only? I tried
df %>% gsub("bl","",df$Color)
but I get error.
Warning message:
In gsub(., "bl", "", df$Color) :
argument 'pattern' has length > 1 and only the first element will be used
Please help.