How can I delete rows in a DF that have letters on it when they are supposed to be numbers? A table example might be:
DT = data.table(x=c("b","b","b","a","a"),v=rnorm(5), j=c("122","1223","g21bg","43","534"))
DF=data.frame(DT)
And I need to get:
x v j
b 0.4220836 122
b -1.9492471 1223
a 1.4615694 43
a -0.2294917 534
Could be any character non numeric. I tried
library(stringr)
str_detect(DF$j, letters)
But I get:
Error in check_pattern(pattern, string) : Lengths of string and pattern not compatible