Skip to content

R_alloc problems in R v1.11

4 messages · Marie-Hélène Ouellette, Uwe Ligges, Kjell Konis

#
Dear Dr. Ripley,

I'm using the R v1.11 on Macintoch and I seem to have a problem with the
function R_alloc. It crashes when using the following .C function (only an
example):

///////////////////////////////
# include <R.h>
void Hello(int *n)
{
int i,x;
for(i=1;1< *n ; i++)
{
	Rprintf('salut!!!\n');
}
x = (int *) R_alloc(5,sizeof(int));
}

///////////////////////////////

I call it in R with this line:

.C('Hello',as.integer(5))

Any idea why and how I can resolve this problem?

Thank you for your time,
Marie-H?l?ne
#
Marie-H?l?ne Ouellette wrote:

            
This is R-devel, among hundreds of other readers, Prof. Ripley is 
perhaps listening as well.

There is no reason to send dozens of messages. Please read the posting 
guide.
There is no version 1.11, and there never was. Current is 2.1.1 anything 
older than 2.x.y is unsupported these days.
Do you mean
   i < *n
???
What about using double quotes?
What is this intended to do???

Uwe Ligges
#
On 6 Jul 2005, at 22:06, Uwe Ligges wrote:

            
The latest version of R for OSX available on CRAN (R-2.1.0a.dmg)  
reports itself as "Version 1.11 (1.11)".  This is actually the  
version of the Macintosh GUI and not the underlying R framework  
(which is 2.1.0) but it is found where traditional mac users are  
going to look to find the version information: R -> About R.

I think I may have also stumbled across a tiny little bug in .C.  I  
forgot to capitalize Hello:

 > .C("hello", as.integer(5))
Error in .C("hello", as.integer(5)) : "C" function name not in load  
table

I think it should say '"hello" function name not in load table'.

Kjell
#
Kjell Konis wrote:

            
No, it is intended to say "C" or "Fortran", AFAICS.

Uwe Ligges