zero_one: Convert vector to 0's and 1's

Description Usage Arguments Examples

View source: R/zero_one.R

Description

JAGS and Stan generally require the dichotymous data be coded as 0's and 1's. This function converts other data fromats to 0's and 1's.

Usage

1
zero_one(x, one = NULL)

Arguments

x

a vector

one

A vector of values to be coded as 1. All other values will be coded as 0. If NULL, a defult choice is made.

Examples

1
zero_one(iris$Species)

rpruim/CalvinBayes documentation built on April 12, 2021, 1:49 p.m.