[Rd] [ALTREP] What is the meaning of the return value of Is_sorted and No_NA function?

Wang Jiefei @zwj|08 @end|ng |rom gm@||@com
Tue Sep 3 20:49:56 CEST 2019


I would like to figure out the meaning of the return value of these two
functions. Here are the default definitions I find from R source code:

static int altreal_Is_sorted_default(SEXP x) { return UNKNOWN_SORTEDNESS; }

static int altreal_No_NA_default(SEXP x) { return 0; }

I guess the macro *UNKNOWN_SORTEDNESS *in *Is_sorted* and 0 in *No_NA
*simply means
unknown sorted/NA status of the vector, so R will loop over the vector and
find the answer. However, what should we return in these functions to
indicate whether the vector has been sorted/ contains NA? My initial guess
is 0/1 but since *NA_NA *uses 0 as its default value so it will be
ambiguous. Are there any macros to define yes/no return values for these
functions? I would appreciate any thought here.



	[[alternative HTML version deleted]]

More information about the R-devel mailing list