Learn R Programming

spots (version 0.1.0)

HnnImpute: Hexagonal nearest neighbor based imputation

Description

Data imputation and smoothing using hexagonal nearest neighbor.

Usage

HnnImpute(data, dist.hnn, dist.k = NULL, mu = 0, sigma = 1)

Arguments

data

A data matrix with features as rows and observations as columns.

dist.hnn

A hexagonal nearest neighbor distance matrix.

dist.k

The maximum distance used to calculate the weight. Default is NULL and all neighbor weights are calculated.

mu

The mean of Gaussian filter, default is 0.

sigma

The standard deviation of Gaussian filter, default is 1.

Value

Imputed data.

See Also

HnnWeight

Examples

Run this code
# NOT RUN {
{
data.use <- quakes[1:100,]
dist.use <- as.matrix(dist(data.use[,1:2]))
# transpose the data to have features in rows and observations in columns
res <- HnnImpute(t(data.use[,3:4]), dist.use)
}

# }

Run the code above in your browser using DataLab