sis_discretize: Discretize continuous trait data

View source: R/processdata.R

sis_discretizeR Documentation

Discretize continuous trait data

Description

Converts a vector of numbers into a vector of 0 and 1 based on whether they are below or above some value. There are two ways to do this: based on percentile or based on a numeric cutoff. By default, it will separate it based on the 50th percentile (cutoff of 0.5), but you can change the cutoff value and whether it is used as percentile or trait value.

Usage

sis_discretize(x, cutoff = 0.5, use_percentile = TRUE)

Arguments

x

Vector of continuous trait values

cutoff

Value to use as cutoff. If percentile, 0.3 = 30th percentile, etc.

use_percentile

If TRUE, use cutoff as percentile

Value

a vector of 0 and 1 (and NAs)


bomeara/sisters documentation built on Oct. 11, 2023, 12:14 a.m.