Skip to content
Permalink
master
Switch branches/tags
Go to file
 
 
Cannot retrieve contributors at this time

Compile C code

# is gcc there?
Sys.which("gcc")
##            gcc 
## "/usr/bin/gcc"

Does engine = 'c' work?

void square(double *x) {
  *x = *x * *x;
}

Test the square() function:

.C("square", 9)
## [[1]]
## [1] 81
.C("square", 123)
## [[1]]
## [1] 15129