IntroducingNA: Introducing NAs to the specified matrix.
Description
`IntroducingNA` introduces missing values (NAs) to the specified data matrix.
Usage
IntroducingNA(dataMatrix, percentage = 0.05, ...)
Value
The output is given as a matrix.
Arguments
dataMatrix
Name of the input matrix (or list, or data frame).
percentage
Desired percentage of missing values (NAs) in each row.
...
Additional parameters passed to other functions.
Details
The procedure changes randomly some values in the specified matrix to "missing values" (denoted by NA).
Number of these missing values in each row is given by the parameter percentage.
If the input is a list of fuzzy numbers or data frame, then it is automatically converted to a matrix.
# prepare matrix with 3 columns and 3 rowsmatrix1 <- matrix(c(1,3,5,2,5,7,1,4,5),ncol=3,byrow = TRUE)
# add 1 NA in each rowset.seed(12345)
IntroducingNA(matrix1,percentage = 0.33)