Hi and thanks for reading me
Im trying to convert the columns of a df in to numeric values, but it doesnt work, anyone nows why? The code is the following:
datos <- data.frame(dato1 = c(1,2,3),
porcentaje = c("1%", "2%", "3%")
)
datos <- datos |>
as.numeric(as.numeric(sub("%", "", datos$porcentaje)))