Learn R Programming

na.tools (version 0.3.1)

na.bootstrap: na.bootstrap

Description

Replace missing values with value randomly drawn from x

Usage

na.bootstrap(.x, ...)

na.resample(.x, ...)

Arguments

.x

vector with

...

additional arguments passed to base::sample()

Details

na.random replaces missing values by sampling the non-missing values. By default aampling occurs with replacement since more valuables may be needed than are available. This function is based on base::sample().

The default is to replace bv sampling a population defined by the non-missing values of .x with replacement

na.random is an alias for na.bootstrap. `

See Also

Examples

Run this code
# NOT RUN {
  x <- c(1,NA,3)
  na.bootstrap(x)
  
# }

Run the code above in your browser using DataLab