NA_Real Values in For Loop

Do you need to use a loop? Can you provide a reproducible example?