PopMiss: Populate Missing Value

Description Usage Arguments Author(s) See Also Examples

Description

This function allows you to populate missing values.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
PopMiss(data,na.treatment=c("mean.or.mode","delete","replace"),replace=NULL)

## S3 method for class 'factor'
PopMiss(data, na.treatment, replace)

## S3 method for class 'character'
PopMiss(data, na.treatment, replace)

## S3 method for class 'integer'
PopMiss(data, na.treatment, replace)

## S3 method for class 'Date'
PopMiss(data, na.treatment, replace)

## S3 method for class 'numeric'
PopMiss(data, na.treatment, replace)

## S3 method for class 'data.frame'
PopMiss(data, na.treatment, replace)

## S3 method for class 'data.table'
PopMiss(data, na.treatment, replace)

## S3 method for class 'matrix'
PopMiss(data, na.treatment, replace)

Arguments

data

This could be data frame,data.table, matrix or a vector.

na.treatment

One of "mean.or.mode", "delete", or "replace", to specify the method to populate missing values.

replace

A single value used for populating ALL missing value. May not be useful for a data frame with missing values in different type of variable.

Author(s)

Sixiang Hu

See Also

DetMiss

Examples

1
2
a <- c(sample(LETTERS,5),NA)
PopMiss(a,"mean.or.mode")

SixiangHu/DataMan documentation built on May 9, 2019, 1:48 p.m.