randomFillAndRepeatDataRow: Fill unmatched datarow in GLoMo

Description Usage Arguments Value Note Author(s) See Also Examples

View source: R/GLoMo.r

Description

Is only called from within predict.GLoMo to handle the unlikely case of a row that has no matching row(s) in the GLoMo uids.

Note: this really only is unlikely in the setting that I plan to use it in, i.e.: impute in the original data from a GLoMo fit to it.

Usage

1
randomFillAndRepeatDataRow(currow, obsneeded, levelslist, newdata)

Arguments

currow

(unmatched) row of data for which to sample

obsneeded

how many rows should be 'sampled'

levelslist

list holding (possible) levels for all columns in currow

newdata

complete dataset from which currow was one.

Value

a data.frame or numdfr (dependent on the dfr that was used in the original call to GLoMo that holds the sampled data.

Note

Really only intended as an internal function. Kept public for who knows what.

Author(s)

Nick Sabbe ([email protected])

See Also

GLoMo-package, NumDfr, predict.GLoMo

Examples

1
2
3
4
5
iris.md<-randomNA(iris, 0.1)
iris.md.nd<-numdfr(iris.md)
mdrow<-min(which(apply(iris.md, 1, function(currow){any(is.na(currow))})))
randomFillAndRepeatDataRow(currow=iris.md.nd[mdrow,], obsneeded=10,
	levelslist=allLevels(iris.md.nd), iris.md.nd)

GLoMo documentation built on May 31, 2017, 3:35 a.m.