Learn R Programming

dprep (version 2.1)

ce.knn.imp: Function that calls ec.knnimp to perform knn imputation

Description

This function simply sets up the dataset so that missing values can be imputed by knn imputation. ec.knnimp is the function that actually carries out the imputation.

Usage

ce.knn.imp(m, natr = rep(0, 0), k1)

Arguments

m
matrix containing relevant variables and classes
natr
list of nominal attributes
k1
number of neighbors to use for imputation

Value

  • rmatrix with missing values imputed

Examples

Run this code
data(hepatitis)
hepa.knnimp=ce.knn.imp(hepatitis,natr=c(1,3:14),k1=10)

Run the code above in your browser using DataLab