From b.rowlingson at lancaster.ac.uk  Fri Nov 16 22:07:13 2007
From: b.rowlingson at lancaster.ac.uk (Barry Rowlingson)
Date: Fri, 16 Nov 2007 21:07:13 +0000
Subject: [Rd] Returning vectors of two different data types back to R
 environment (from C).
In-Reply-To: <8adccabf0711161249n763c3290o1ec4bab4bea1a104@mail.gmail.com>
References: <8adccabf0711161249n763c3290o1ec4bab4bea1a104@mail.gmail.com>
Message-ID: <473E0681.8040508@lancaster.ac.uk>

Charles Danko wrote:
> Hello,
> 
> Quick question.
> 
> I have written a C function - I would like to make it return two vectors to
> the R environment - one STRSXP vector, and one INTSXP vector.  Is this
> possible/ easy to do using the API?
> 
> I looked, but could not find the answer to this  question in the "Writing R
> Extensions" guide.

  How does any R function return two different-typed values back to its 
caller? With a list - like list(foo=1,bar='baz'). Construct an R list in 
your C code and return that... R Extensions should tell you how!

Barry



[Rd] Returning vectors of two different data types back to R environment (from C).
Barry Rowlingson