test variable with demographic

I want to test and see if there is any relationship between gender and "I do not know" variable in my database. Is there any way that I can do it with R? Let's say gender is like 1 and 2 or Male and Female. I have a scale question from 1-10 and 99 is "I do not know" option. How can I test the relationship between them?

Thanks