defaultIf: Return a Default Value for Values Meeting a Condition

View source: R/default.R

defaultIfR Documentation

Return a Default Value for Values Meeting a Condition

Description

Return a Default Value for Values Meeting a Condition

Usage

defaultIf(FUN.test, x, default, count = FALSE)

Arguments

FUN.test

function returning vector of logical, to be applied to x

x

vector in which to set default values

default

value to be set in x at those positions where FUN.text returns TRUE

count

if TRUE (the default is FALSE) the number of replaced values is returned in the attributes count


KWB-R/kwb.utils documentation built on April 1, 2024, 7:12 a.m.