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 26 27 28 29 30 31 32 33 34 35 36 37 38
|
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/makemissing.R
\name{makemissing}
\alias{makemissing}
\title{Create random missing data}
\usage{
makemissing(
data,
p = 0.2,
cols = seq_len(ncol(data)),
rowwise = FALSE,
nafun = function(x) x,
seed = NULL
)
}
\arguments{
\item{data}{data.frame}
\item{p}{Fraction of missing data in each column}
\item{cols}{Which columns (name or index) to alter}
\item{rowwise}{Should missing occur row-wise (either none or all selected columns are missing)}
\item{nafun}{(Optional) function to be applied on data.frame before return (e.g. \code{na.omit} to return complete-cases only)}
\item{seed}{Random seed}
}
\value{
data.frame
}
\description{
Generates missing entries in data.frame/matrix
}
\author{
Klaus K. Holst
}
\keyword{utilities}
|