From faheem at email.unc.edu  Mon Jan 31 16:39:03 2005
From: faheem at email.unc.edu (Faheem Mitha)
Date: Mon Jan 31 16:39:09 2005
Subject: [Rd] type of list elements in .Call
In-Reply-To: <41FE4B01.3090601@lancaster.ac.uk>
References: <Pine.LNX.4.61.0501310953100.10677@Chrestomanci>
	<41FE4B01.3090601@lancaster.ac.uk>
Message-ID: <Pine.LNX.4.61.0501311037101.10677@Chrestomanci>



On Mon, 31 Jan 2005, Barry Rowlingson wrote:

>
>> as I would expect. I thought that if the vectors in the list could be 
>> regarded as integer vectors, they would be coerced appropriately, but 
>> apparently not. Is there any way I can tell R to regard them as integer 
>> vectors?
>
> Change:
>
> .Call("printlst", list(c(1,2),c(3,4)))
>
> To:
>
> .Call("printlst", list(as.integer(c(1,2)),as.integer(c(3,4))))

Thanks for the suggestion. However, I want to do the coercion at the level 
of the C/C++ code. Also, I don't want to have to manually insert multiple 
calls to as.integer if possible.

                                                                  Faheem.


[Rd] type of list elements in .Call
Faheem Mitha