GetDataFrame: Convert imputed data to a dataframe, using the same setting...

View source: R/ArrayUtils.R

GetDataFrameR Documentation

Convert imputed data to a dataframe, using the same setting from original input data.

Description

This is a utility function to convert the imputed data matrix to a dataframe. This function will be implemented as a RCPP internal function later on.

Usage

GetDataFrame(dest, from, cols = 1:NCOL(from))

Arguments

dest

the imputed output data matrix.

from

the original input dataframe.

cols

optinal. Always use default for now.

Value

The returned dataframe object for imputed data.

Examples

require(NPBayesImputeCat)
#Please use NYexample data set for a more realistic example
data('NYMockexample')

#create the model
model <- CreateModel(X,MCZ,10,10000,0.25,0.25,8888)

#run 1 burnins, 2 mcmc iterations and thin every 2 iterations
model$Run(1,2,2,TRUE)

#retrieve parameters from the final iteration
result <- model$snapshot

#convert ImputedX matrix to dataframe, using proper factors/names etc.
ImputedX <- GetDataFrame(result$ImputedX,X)
#View(ImputedX)

NPBayesImputeCat documentation built on Oct. 3, 2022, 5:05 p.m.