If your numbers always precede the characters, this should work.
library(stringr)
VEC <- c(1,2,3,"4ER","5ERT",1)
VEC
#> [1] "1" "2" "3" "4ER" "5ERT" "1"
NewVec <- str_extract(VEC,"^\\d+")
NewVec <- as.numeric(NewVec)
NewVec
#> [1] 1 2 3 4 5 1
Created on 2021-01-15 by the reprex package (v0.3.0)