Re: [Rd] Issue when calling deparse(substitute(x)) from C with anonymous R vectors ?

2009-11-19 Thread Peter Dalgaard
Laurent Gautier wrote: Dear list, When calling R from C, what appears like a spurious error can be triggered during the execution of chisq.test(x, y). This is happening when the following conditions are met: - x and y are anonymous C-level R vectors (they do not have a symbol), but

Re: [Rd] Issue when calling deparse(substitute(x)) from C with anonymous R vectors ?

2009-11-19 Thread Prof Brian Ripley
This is easy to reproduce in R: chisq.test(c(1000, 1001, 1002, 1003, 1004, 1005, 1006, 1007, 1008, 1009, 1010, 1011), c(1000, 1001, 1002, 1003, 1004, 1005, 1006, 1007, 1008, 1009, 1010, 1011)) The simple answer is: don't do that. It is unclear what is a reasonable label to give in such a

Re: [Rd] Issue when calling deparse(substitute(x)) from C with anonymous R vectors ?

2009-11-19 Thread Laurent Gautier
Thanks to you and Peter for the quick answer. I should definitely have tried I R. It just seemed to me so unlikely that no one ever reported that anonymous vectors would fail with chisq.test(). Having a label that would be x or y is along the lines of something I was thinking of, and this

Re: [Rd] Issue when calling deparse(substitute(x)) from C with anonymous R vectors ?

2009-11-19 Thread Prof Brian Ripley
On Thu, 19 Nov 2009, Laurent Gautier wrote: Thanks to you and Peter for the quick answer. I should definitely have tried I R. It just seemed to me so unlikely that no one ever reported that anonymous vectors would fail with chisq.test(). Having a label that would be x or y is along the

Re: [Rd] Issue when calling deparse(substitute(x)) from C with anonymous R vectors ?

2009-11-19 Thread Duncan Murdoch
Can you put together a minimal, self contained example, not requiring an external system? This has the symptoms of a bug in the external code (e.g. a missing PROTECT), but it is possible it's a bug in R. Duncan Murdoch On 19/11/2009 2:40 AM, Laurent Gautier wrote: Dear list, When calling

Re: [Rd] Issue when calling deparse(substitute(x)) from C with anonymous R vectors ?

2009-11-19 Thread Duncan Murdoch
On 19/11/2009 6:32 AM, Duncan Murdoch wrote: Can you put together a minimal, self contained example, not requiring an external system? This has the symptoms of a bug in the external code (e.g. a missing PROTECT), but it is possible it's a bug in R. And I should have read the followups before

[Rd] Issue when calling deparse(substitute(x)) from C with anonymous R vectors ?

2009-11-18 Thread Laurent Gautier
Dear list, When calling R from C, what appears like a spurious error can be triggered during the execution of chisq.test(x, y). This is happening when the following conditions are met: - x and y are anonymous C-level R vectors (they do not have a symbol), but they are protected from garbage