I have a list "ans" here are its few entries
[[93]]
[1] "<dd>male, 31 years old</dd>" "black male"
[3] "31"
[[94]]
character(0)
[[95]]
[1] "<dd>female, 23 years old</dd>" "female"
[3] "23"
[[96]]
[1] "<dd>male, 23 years old</dd>" "male"
[3] "23"
I have to find if each entries matches a certain age
so I have a loop like this
for(item in ans){
if(item[3] && item[3]==age){
count = count + 1
}
}
but their are some entries like
[[94]]
character(0)
due to which I am getting a error : missing value where TRUE/FALSE needed
how do I get rid of this problem