From edd at debian.org  Tue Nov 26 18:19:02 2013
From: edd at debian.org (Dirk Eddelbuettel)
Date: Tue, 26 Nov 2013 11:19:02 -0600
Subject: [Rd] dynamic lists at C level
In-Reply-To: <CAJ=0CtC=OMdefDWh67amdupD5q0xWWnU_4qfTXmGJKUQECiyMg@mail.gmail.com>
References: <CAJ=0CtCn-GKHZ6VhNxuVbHF0oSpVrSYN_7Yy6swOHi4x1-25Hw@mail.gmail.com>
	<21140.53153.880034.556888@max.nulle.part>
	<CAJ=0CtC=OMdefDWh67amdupD5q0xWWnU_4qfTXmGJKUQECiyMg@mail.gmail.com>
Message-ID: <21140.55302.347287.625675@max.nulle.part>


Hi Adrian,

On 26 November 2013 at 18:57, Adrian Du?a wrote:
| Thanks for your reply, at some point I did consider the possibility of
| using Rcpp, but at that time I had already wrote a considerable amount
| of regular C code.
| 
| Now I am only trying to extend that code a little, translating
| everything in Rcpp would probably consume more time (although I agree
| it might be easier to use).

Well there is no need to translate a single line. C++ works happily with your
C code.  But instead of creating the list in C (which you had difficulty
with) you would create it in C++.

| I read the "Writing R Extensions" manual, I could only find how to
| handle with R lists in C (section 5.9.6 Handling lists), but I could
| not find how to <create> a list in C, and access its components, and
| this is basically where I got stuck.

Gabor gave you a good pointer.  Grep'ing through existing packages is often a
good idea.  If you can stomach reading other people's code ;-)

Dirk

-- 
Dirk Eddelbuettel | edd at debian.org | http://dirk.eddelbuettel.com



[Rd] dynamic lists at C level
Dirk Eddelbuettel