[Rd] Creating data.frame from c-language

Prof Brian Ripley ripley at stats.ox.ac.uk
Sat Aug 10 15:17:50 CEST 2013


On 09/08/2013 22:48, Boris Aronshtam wrote:
> I need to create a data.frame from C-language and populate it. I Know how to create lists from C, but I cannot figure out how to create a data.frame. Does anyone have a sample code for creating a data.frame, setting column names, and populating it with data?

Use data.frame() via an eval() call from C.

Or see the code is stats/src/model.c, as part of model.frame.default 
(but I would only do that if speed were essential).

-- 
Brian D. Ripley,                  ripley at stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595



More information about the R-devel mailing list