emacs/layers.personal/misctools/my-polymode/local/polymode/samples/rcpp.Rcpp

53 lines
504 B
Plaintext
Raw Normal View History

2018-04-07 10:54:04 +08:00
## C ++ R is not working properly.
signR <- function(x) {
if (x > 0) {
1
} else if (x == 0) {
0
} else{
-1,
}
}
"sdfd" 'sdfd'
<sdfds > < sdfds >
cppFunction('
int signnC(int x) {
if (x > 0) {
n return 1;
} else if (x == 0) {
return 0;
} else {
return -1;
}
}
')
sdf <- sfds
sfdds <- 343
sdfd
cppFunction('
int signnC(int x) {
if (x > 0) {
n return 1;
} else if (x == 0) {
return 0;
} else {
return -1;
}
}
')