NA/NaN/Inf in foreign function call question

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

NA/NaN/Inf in foreign function call question

niki
Dear all,

I have a datafile where I run haplo.GLM analyses using several variables (a matrix). However, when I include a certain binary variable (0,1) I get this message

Error: NA/NaN/Inf in foreign function call (arg 4)

I don't get an error when I include another binary variable, again with only 0,1.
Both variables don't have missing values, they only have 0 and 1.
Why do I get an error with one and not the other? It is really strange.

Does anyone know what do I have to check? or how to exclude NA/NaN/Inf ? Or any other solution?

Thanks,

Niki




Reply | Threaded
Open this post in threaded view
|

Re: NA/NaN/Inf in foreign function call question

Uwe Ligges-3
Probably some division by zero is done somewhere internally. We cannot
say more since this is not reproducible for us.

Uwe LIgges



On 13.12.2011 18:29, niki wrote:

> Dear all,
>
> I have a datafile where I run haplo.GLM analyses using several variables (a
> matrix). However, when I include a certain binary variable (0,1) I get this
> message
>
> Error: NA/NaN/Inf in foreign function call (arg 4)
>
> I don't get an error when I include another binary variable, again with only
> 0,1.
> Both variables don't have missing values, they only have 0 and 1.
> Why do I get an error with one and not the other? It is really strange.
>
> Does anyone know what do I have to check? or how to exclude NA/NaN/Inf ? Or
> any other solution?
>
> Thanks,
>
> Niki
>
>
>
>
>
>
> --
> View this message in context: http://r.789695.n4.nabble.com/NA-NaN-Inf-in-foreign-function-call-question-tp4191250p4191250.html
> Sent from the R help mailing list archive at Nabble.com.
>
> ______________________________________________
> [hidden email] mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Reply | Threaded
Open this post in threaded view
|

Re: NA/NaN/Inf in foreign function call question

ejoffe
This post has NOT been accepted by the mailing list yet.
In reply to this post by niki
Just had a similar problem.
On my dataset when I ran glmnet only with variables I knew for sure were numeric and without NAs it ran fine.
When I tried it on my entire dataset it crashed.

It seems the reason is that glmnet expects as input to matrices of numeric values.
If you have non numeric or NA values it seems to crash.

Not sure I am right, but thought it might benefit others if I share
Reply | Threaded
Open this post in threaded view
|

Re: NA/NaN/Inf in foreign function call question

namesj
This post has NOT been accepted by the mailing list yet.
In reply to this post by niki
One reason for this error could be that the variable defined in your data frame is different from their actual data type. for eg you define 'Char' for 'Date' vaiable .