I have a dataset where few data are "?"(see below image for reference)
workclass has a single "?" in this sample data
age workclass fnlwgt education education_num marital_status
39 State-gov 77516 Bachelors 13 Never-married
31 Private 45781 Masters 14 Never-married
42 Private 159449 Bachelors 13 Married-civ-spouse
30 Private 188146 HS-grad 9 Married-civ-spouse
30 Private 59496 Bachelors 13 Married-civ-spouse
44 Private 343591 HS-grad 9 Divorced
44 Private 198282 Bachelors 13 Married-civ-spouse
32 Self-emp-inc 317660 HS-grad 9 Married-civ-spouse
17 ? 304873 10th 6 Never-married
28 Private 377869 Some-college 10 Married-civ-spouse
38 Self-emp-not-inc 120985 HS-grad 9 Married-civ-spouse
40 Federal-gov 56795 Masters 14 Never-married
sample of my dataset I have tried filter, where and few other matching functions but it doesnt capture the ? in a string or int as well.
I am new to R language and not able to get a solution for this.
I want to get a count of data which has "?" in it and then based on the count decide to remove the rows or fill it with some meaningful data.
UPDATE :::
I data was " ?" rather than "?". Couldnt make out by looking at it Once i got that info was able to handle it. It was a human error rather than the data/code i was trying :D