| sim_mat | R Documentation |
sim_mat() generates random normal data with optional compound-symmetric
column correlation. Values can optionally be scaled to the interval
[0, 1] column-wise. The function also creates feature metadata for columns
and sample metadata for rows, and can inject NA values into a specified
proportion of matrix cells across a specified proportion of columns.
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 |
Integer. Number of rows, interpreted as samples. Defaults to |
p |
Integer. Number of columns, interpreted as features. Defaults to
|
rho |
Numeric. Compound-symmetric column correlation before optional
scaling. Defaults to |
n_col_groups |
Integer. Number of groups to assign to features.
Defaults to |
n_row_groups |
Integer. Number of groups to assign to samples.
Defaults to |
perc_total_na |
Numeric scalar between |
perc_col_na |
Numeric scalar between |
beta |
Logical. If |
Generate a numeric matrix with optional row and column metadata and added missing values.
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 missing values.
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.