Re: [Rd] Call C code from R

From: Prof Brian Ripley <ripley_at_stats.ox.ac.uk>
Date: Mon, 17 Sep 2007 08:08:25 +0100 (BST)

On Mon, 17 Sep 2007, ????? ?. ??????? wrote:

> Hello, All!
>
> I'm new for R-devel list. And I'd like to ask some questions,
> maybe they will be stuped for the most part of members of the
> list.
> I need to call function which is written in C++ from R.

Your subject line says C ....

> My questions are:
> 1. How should I include libraries (for example, iomanip,
> sstream, iostream)?
> 2. Can I use namespace?

What you link into R is a shared object aka DLL. If you use the documented ways (e.g. R CMD CHLIB) to make this, it will be linked against the platform's standard C++ libraries. There are lots of examples of C++ code in CRAN packages doing this.

The use of iostream is discussed in 'Writing R Extensions'.

-- 
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

______________________________________________
R-devel_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel
Received on Mon 17 Sep 2007 - 07:18:01 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 Mon 17 Sep 2007 - 12:41:21 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.