vec_assign: Assigns binary values to a vector

Description Usage Arguments Value Examples

View source: R/choix_seuil.R

Description

This function will assign 0 if value < seuil, 1 otherwise.

Usage

1
vec_assign(vecteur, seuil = 0.5)

Arguments

vecteur

A numeric vector to transform.

seuil

A numeric indicating the decision threshold. 0.5 is the default value.

Value

A vector with 0 and 1 values.

Examples

1
2
3
4
vector <- c(0.2,0.6,0.75,0.05)
vector <- vec_assign(vector,0.6)
print(vector)
## [1] 0 1 1 0

guillaumelf/BarchenPackage documentation built on Sept. 24, 2017, 9:20 p.m.