I know this might be a duplicate, but I couldn't apply or completely understand the similar questions I read.
I have a column with grades that is supposed to have numeric entries. However during the data - entry manual process some rows of that column have some non numeric entries.These consist of text or a combination of text and numbers. Is there any way I can find any entry that is not consisted only of numbers? I am suspecting I need regular expressions but I am not sure.
My column looks like:
grades <- c(12, "missing", 20, 10, "accommodated-18", 13, "accommodated-20", 20, "sick", 17)
I know that some rows have a "missing" and and an "accommodated" word in them so I can locate them by using grep.
grades_missing <- grep(pattern = "missing", x = grades)
grades_missing_index <- as.vector(grades_missing)
missing <- grades_missing[isbn_missing_index,]
Which returns to me all the rows that have the word missing in them. Similarly I do this for the "accommodated". But if there are more non-entirely-numeric entries and I am not aware of them, how I can find them? For example I would need something that will tell me that rows 2,5,7,9 have non numeric entries. (And then by using the vector indices I will be able to see them. (Something similar to what I did before).
Any ideas?