| sim_mat | R Documentation |
Generates a matrix of random normal data, then optionally scales values
between 0 and 1 column-wise. It also creates corresponding data frames for feature
(column) and sample (row) metadata and can optionally introduce NA values
into a specified proportion of rows. A correlation between columns rho
(before scaling) can be added.
sim_mat(
n = 100,
p = 100,
rho = 0.5,
n_col_groups = 2,
n_row_groups = 1,
perc_total_na = 0.1,
perc_col_na = 0.5,
beta = TRUE
)
n |
An integer specifying the number of rows (samples). Default is |
p |
An integer specifying the number of columns (features). Default is |
rho |
Columns correlation before scaling (compound symmetry). Default is |
n_col_groups |
An integer for the number of groups to assign to features/columns. Default is |
n_row_groups |
An integer for the number of groups to assign to samples/rows. Default is |
perc_total_na |
Proportion of all cells to set to NA. Default is |
perc_col_na |
Proportion of columns across which those NAs are spread. Default is |
beta |
If |
An object of class slideimp_sim. This is a list containing:
input: A numeric matrix of dimension n \times p containing
the simulated values and injected NAs.
col_group: A data frame with $p$ rows mapping each feature
to a group.
row_group: A data frame with $n$ rows mapping each sample
to a group.
set.seed(123)
sim_data <- sim_mat(n = 50, p = 10, rho = 0.5)
sim_data
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.