Subsetting dataset to include numerical values in a column

Can you put your question into reproducible example form (reprex)? It'll help everyone to answer your question most efficiently.

The approach I'd take is to use regex to find lines where there is anything else other than numbers. It'll look something like this:

vec <- c("78443", "2445", "78789", "6dfg546")
grepl(pattern = "[a-zA-Z]", x = vec)
[1] FALSE FALSE FALSE  TRUE

You can use result to filter out any rows that contain letters.

3 Likes