constant: constant

Description Usage Arguments Details Value Author(s) Examples

View source: R/impute.r

Description

Helper function for imputing constants

Usage

1
constant(n = 1)

Arguments

n

The value to return

Details

Returns a function that always returns the value of n.

Value

A function that when used simply returns n.

Author(s)

Jared P. Lander

Examples

1
2
3
4
5
6
constant(4)(1:10)

theDF <- data.frame(A=1:10, B=1:10, C=1:10)
theDF[c(1, 4, 6), c(1)] <- NA
theDF[c(3, 4, 8), c(3)] <- NA
simple.impute(theDF, constant(4))

useful documentation built on June 7, 2017, 9:02 a.m.