Thinking about a data.frame lets say:
df <- data_frame(id = c(1, 1, 2, 2), n = c("100+", "50+", "30+", "40+"))
Column n
should be to converted to c("100","50","30","40")
by using str_replace()
within dplyr library.
I need something like this to work on:
library(dplyr)
library(stringr)
df %>%
mutate(n = str_replace("+",""))
There must be a proper way to apply str_replace()
function for a column with dplyr.