handle 'NA' results from R