igraph-help
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [igraph] Adding a C function to the igraph R package


From: Mile Sikic
Subject: Re: [igraph] Adding a C function to the igraph R package
Date: Thu, 17 Sep 2009 13:26:16 +0200

Hi Gabor,

thank you for your replay.
The intention was to include my function in R version of igraph I had installed on my computer. I use 0.5-main version downloaded from Launchpad. 
I have found some instructions here http://www.caip.rutgers.edu/~vincentm/LINKS/R_Notes.html . But I think that it is a little bit outdated.

The function is based on igraph and used igraph structures.
I am planning to write more function using your nice library and in the future I have intention to share my code, but before that I would like to learn more and make more tests to check if everything works.

regards

Mile Sikic



On Thu, Sep 17, 2009 at 12:19 PM, Gábor Csárdi <address@hidden> wrote:
Hi Mile,

sorry for the late reply, I was offline for a while.

So, to include your function, download the source R package and
uncompress it. Then put your function in a C file into the 'src'
directory. This was the easy part.

A bit harder part is, that you need to write two interface functions
to it, one in R, one in C. The one in C you can put into rinterface.c,
the other one into some R file in the R/ directory. You also need to
put the name of your function into the NAMESPACE file.

To write the interface functions, you can use the already existing
ones as examples and the ultimate documentation is of course 'Writing
R extensions', http://cran.r-project.org/doc/manuals/R-exts.html

Btw. if you think your function might be of interest for a broader
audience and you are willing to share the code, and write some
documentation as well, then you can send it to us and we will put it
into igraph.

Best,
Gabor

On Mon, Sep 14, 2009 at 5:14 PM, Mile Sikic <address@hidden> wrote:
> Hello
>
> I have made my own c function using igraph c libraries. How I can add this
> function to the igraph R package. I am using 0.5.2. version on ubuntu linux.
>
> Regards
>
> Mile SIkic
>
> _______________________________________________
> igraph-help mailing list
> address@hidden
> http://lists.nongnu.org/mailman/listinfo/igraph-help
>
>



--
Gabor Csardi <address@hidden>     UNIL DGM


_______________________________________________
igraph-help mailing list
address@hidden
http://lists.nongnu.org/mailman/listinfo/igraph-help


reply via email to

[Prev in Thread] Current Thread [Next in Thread]