[Rd] hello World problem
Liaw, Andy
andy_liaw at merck.com
Thu Jan 12 16:49:34 CET 2006
See the `Value' section of ?.C. Also, it's better to use the i/o provided
by the R API; i.e., something like:
#include "R.h"
void helloworld() {
Rprintf("Hello world!\n");
}
Andy
From: Romain Francois
>
> Hi,
>
> I'm trying to build a simple R package 'helloWorld' with just one
> function that prints 'hello World' on the C side.
> I agree that it is completely useless, but I just start
> mixing R and C.
>
> My C file is as follows :
>
> #include <stdio.h>
> void helloWorld() {
> printf("hello world !\n") ;
> }
>
> When I call it from R, here is what happens :
> R> .C("helloWorld", PACKAGE = "helloWorld")
> hello world !
> list()
>
> is it normal that 'list()' is printed ?
>
> Thanks.
>
> Romain
>
> --
> visit the R Graph Gallery : http://addictedtor.free.fr/graphiques
> mixmod 1.7 is released :
> http://www-math.univ-> fcomte.fr/mixmod/index.php
>
>
> +---------------------------------------------------------------+
> | Romain FRANCOIS - http://francoisromain.free.fr |
> | Doctorant INRIA Futurs / EDF |
> +---------------------------------------------------------------+
>
> ______________________________________________
> R-devel at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel
>
>
More information about the R-devel
mailing list