bitwiseParity: Compute bitwise parity over a vector or list

bitwiseParityR Documentation

Compute bitwise parity over a vector or list

Description

This function computes the bitwise parity of a set of integer, logical, or raw values, or a list of such vectors. It is a convenient way to collapse a set of UUIDs into a summary value, regardless of the order of the UUIDs.

Usage

bitwiseParity(x, even = TRUE)

## S4 method for signature 'integer'
bitwiseParity(x, even = TRUE)

## S4 method for signature 'logical'
bitwiseParity(x, even = TRUE)

## S4 method for signature 'raw'
bitwiseParity(x, even = TRUE)

## S4 method for signature 'UUIDList'
bitwiseParity(x, even = TRUE)

## S4 method for signature 'list'
bitwiseParity(x, even = TRUE)

Arguments

x

An integer, logical or raw vector or array, or a character vector or array containing hexadecimal values (leading "0x" optional)

even

A logical value specifying whether the parity should be even or odd

Value

  • If x is of length zero, a vector of length zero of the same storage mode as x.

  • If x is a character vector consisting solely of empty strings, "".

  • If x is a character vector containing invalid hexadecimal strings, NA.

  • Otherwise, a vector of length 1 of the same storage mode as x, containing the bitwise parity computed across all elements of x.

Note

If the storage mode of x is "character", the output will be in hexadecimal notation with no leading "0x".

Author(s)

Adam C. Gower agower@bu.edu


agower/GeneHive documentation built on April 14, 2022, 5:08 a.m.