dichot | R Documentation |
Function to dichotomize the input data for the semigroup construction with a cutoff value.
dichot(x, c = 1, diag)
x |
some data in a numeric form (usually arrays) |
c |
the cutoff value to perform the dichotomization (default |
diag |
(optional and logical) whether or not the diagonals should be included (default |
This is a convenient function (or wrapper if you like) of the replace
function.
In this case, the function is aimed to specify a cutoff value for the dichotomization of the data where the values equal or higher to the cutoff are converted to one, while the others are set to zero. The cutoff can be any real number.
Binary values of the input data.
The labels are preserved after the dichotomization.
Antonio Rivero Ostoic
replace
, prev
, semigroup
.
## 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.