Re: [Rd] How to generate R objects in C?

From: Mathieu Ribatet <mathieu.ribatet_at_epfl.ch>
Date: Wed, 03 Jun 2009 10:00:02 +0200

This is indeed details in Writing R Extensions. You should have a closer look at sections 5.9.3 and 5.9.4. Look at the pieces of C code, they will help you a lot.

cheers,
Mathieu

Le mercredi 03 juin 2009 à 00:44 +0200, Kynn Jones a écrit :
> I'm in the process of coding a parser (in C) to generate R entities
> (vectors, lists, etc.) from a text description (different from R).
> The basic parser works, and now I need to tell it how to create R
> entities. I need to be able to create character vectors (for unicode
> strings), integers, floats, unnamed lists, named lists, boolean
> values, and NA. With the exception of the two types of lists and the
> character vectors, all the other objects I need to generate are
> "scalars", so I suppose they will correspond to 1-element vectors in
> R. I also need to be able to add R entities to both kinds of lists.
>
> I've been staring at various official documents (ch 5 of Writing R
> Extensions, R Internals, Rinternals.h) for this kind of work for some
> time, but I can't find the constructors for such objects (here I'm
> using the term "constructor" loosely). I'm even further from finding
> the C equivalent of "my.list[[ length(my.list) + 1 ]] <- new.thing".
>
> Can someone point me in the right direction?
>
> Thanks!
>
> Kynn
>
> ______________________________________________
> R-devel_at_r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel

-- 
Institute of Mathematics
Ecole Polytechnique Fédérale de Lausanne
STAT-IMA-FSB-EPFL, Station 8
CH-1015 Lausanne   Switzerland
http://stat.epfl.ch/
Tel: + 41 (0)21 693 7907

______________________________________________
R-devel_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel
Received on Wed 03 Jun 2009 - 08:10:50 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Wed 03 Jun 2009 - 09:35:16 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-devel. Please read the posting guide before posting to the list.

list of date sections of archive