summaryrefslogtreecommitdiff
path: root/samples/rcpp.Rcpp
blob: 17aff0289d396605144d704ffcb50861d448330f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
## 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;
  }
}

')