When trying to replace values, “missing values are not allowed in subscripted assignments of data frames”
You can use ifelse, like so check if foo meets your criteria and then go ahead and assign it to pe94.person$H03 directly. I find it safer to assign it a new variable and usually use that in subsequent analysis.