no need for special case clamp operator as we will handle NA more generally
define our own version of Rboolean, compatible with the one shipped by R header Boolean.h, but more useful to us as it includes NA_VALUE for missing values
using Rboolean (our own) instead of int as the storage type for logical vectors.