php-r
php-r copied to clipboard
ROutputParser is parsing NA as 0
Hi, please check this function:
public function singleNumber($output)
{
//TODO properly check if r output is a valid number
return 0 + substr($output, 4);
}
The problem is that if the return from R is like this: [0] NA the script will return "0". But 0 is something else than NA, right?
gb5256
Yeah, it should probably return null in this case. Could you please submit a PR?