safe.ifelse: Ifelse function that retains the original class of a variable

Description Usage Arguments

View source: R/summary_statistics.R

Description

Retain the class of a variable when using ifelse. Copied from http://stackoverflow.com/questions/6668963/how-to-prevent-ifelse-from-turning-date-objects-into-numeric-objects.

Usage

1
safe.ifelse(cond, yes, no)

Arguments

cond

Condition

yes

action if variable meets condition

no

action if variable does not meet condition


ksauby/dataproc documentation built on May 20, 2019, 7:02 p.m.