Rboolean: R's boolean type

Description Declaration Examples

Description

\Sexpr[results=rd, stage=render]{c3po:::badge('typedef-enum')}

Rboolean is an enumerated type for boolean variables. The symbolic constants defined by this enumerated type are: FALSE (= 0) and TRUE (= 1).

Declaration

1
typedef enum { FALSE = 0, TRUE /*, MAYBE */ } Rboolean;

In Boolean.h.

Examples

1
2
3
4
5
6
7
8
9
rboolean <- inline::cfunction(NULL,
 ' Rboolean false_x = FALSE;
   Rboolean true_x = TRUE;
   Rprintf("Rboolean FALSE is: %d\\n", false_x);
   Rprintf("Rboolean TRUE is: %d\\n", true_x);
   return R_NilValue;
 ')

invisible(rboolean())

ramiromagno/c3po documentation built on Jan. 5, 2021, 8:01 p.m.