Learn R Programming

multiplex (version 1.5)

dichot: Dichotomize data with a cutoff

Description

Function to dichotomize the input data for the semigroup construction with a cutoff value.

Usage

dichot(x, c = 1)

Arguments

x
some data in a numeric form (usually arrays).
c
the cutoff value to perform the dichotomization.

Value

  • Binary values of the input data.

Details

This is basically the replace function here aimed to specify the cutoff value for the dichotomization of the data. The values equal or higher to the cutoff values are converted to one, otherwise they are set to zero. The default value of the cutoff is 1.

See Also

replace, prev, semigroup.

Examples

Run this code
## Create the data: 2 binary relations among 3 elements
arr <- round( replace( array(runif(18), c(3,3,2)), array(runif(18),
       c(3,3,2))>.5, 3 ) )

## dichotomize it with a cutoff value of 2
dichot(arr, c = 2)

Run the code above in your browser using DataLab