Description Usage Arguments Value Author(s) See Also Examples
Random generation of missing values in matrices
1 | missingmat2(mat, missing)
|
mat |
a matrix (n rows, m columns) |
missing |
a vector: element i contains the desired number of rows with i missing values (1<=i<=m) |
a matrix with the specified pattern of missing values
Alessandro Barbiero, Giancarlo Manzi, Pier Alda Ferrari
1 2 3 4 5 6 7 8 | mat<-matrix(rnorm(500),100,5)
# if you want 20 rows with 1 missing, 10 rows with 2 missing,
# 4 rows with 3 missing, 1 row with 4 missing
missing<-c(20,10,4,1)
matm<-missingmat2(mat, missing)
matm
# check that the function works
missingness(matm)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.