fill_all.mcmcr: Fill All Values

Description Usage Arguments Details Value Methods (by class) See Also Examples

View source: R/fill-all.R

Description

Fills all of an object's (missing and non-missing) values while preserving the object's dimensionality and class.

Usage

1
2
## S3 method for class 'mcmcr'
fill_all(x, value = 0, nas = TRUE, ...)

Arguments

x

An object.

value

A scalar of the value to replace values with.

nas

A flag specifying whether to also fill missing values.

...

Other arguments passed to methods.

Details

It should only be defined for objects with values of consistent class ie not standard data.frames.

Value

The modified object.

Methods (by class)

See Also

Other fill: fill_na()

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
# logical
fill_all(c(TRUE, NA, FALSE))
fill_all(c(TRUE, NA, FALSE, nas = FALSE))
fill_all(c(TRUE, NA, FALSE, value = NA))

# integer
fill_all(matrix(1:4, nrow = 2), value = -1)

# numeric
fill_all(c(1, 4, NA), value = TRUE)
fill_all(c(1, 4, NA), value = TRUE, nas = FALSE)

# character
fill_all(c("some", "words"), value = TRUE)

mcmcr documentation built on Sept. 7, 2021, 1:07 a.m.