We can use grep to subset

df$a[grep('^\\d+$', df$a, invert = TRUE)]
#[1] "a"

data

df <- data.frame(a = c("23", "34", "a", "56"))

CLICK HERE to find out more related problems solutions.

Leave a Comment

Your email address will not be published.

Scroll to Top