[R] Using C code in R

From: Jaimin Dave <davejaiminm_at_gmail.com>
Date: Wed, 23 Mar 2011 19:12:01 -0500


Hi,
I am new to R and I want to know how to use C code which contains two functions one called inside another.I know that how to use C code in R if it has only one function but dont know how to do it in above case. I want to use the same in R .My C code is as follows.

//#include <R.h>

void sayHello();

void g();

void sayhello() {

Rprintf("Hello world %d\n",global);

}

void g()

{

int a=9;

int b=1;

Rprintf("Hello world\n %d",(a+b));

sayHello();

}

Help would be greatly appreciated

Thanks

        [[alternative HTML version deleted]]



R-help_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. Received on Thu 24 Mar 2011 - 02:51:56 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 Thu 24 Mar 2011 - 07:10:24 GMT.

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

list of date sections of archive