is_binary: Checks if dependent variable is binary with values 1 and 0

View source: R/is_binary.R

is_binaryR Documentation

Checks if dependent variable is binary with values 1 and 0

Description

Returns TRUE if dependent.variable.name is a binary variable with the values 1 and 0.

Usage

is_binary(data = NULL, dependent.variable.name = NULL)

Arguments

data

Data frame with a response variable and a set of predictors. Default: NULL

dependent.variable.name

Character string with the name of the response variable. Must be in the column names of data. Default: NULL

Value

Logical.

Examples

if(interactive()){

 #dummy data frame
 data <- data.frame(
   response = c(0, 0, 0, 1, 1)
 )

 #checking if response is binary
 is_binary(
   data = data,
   dependent.variable.name = "response"
 )

}

spatialRF documentation built on Aug. 19, 2022, 5:23 p.m.