Description Usage Arguments Examples
This function creates an object that is ready to be used with peppuR package functions
1 2 | as.MLinput(X, Y, meta_colnames = NULL, categorical_features = FALSE,
sample_cname, outcome_cname, pair_cname = NULL)
|
X |
data.frame or a list of data.frames all with n rows, f+1 columns, where one of the columns is a unique sample identifier |
Y |
(optional) data.frame, one column designating sample id and the other columns give extra info, e.g. outcome, pair. If NULL, Y will be created from X using the meta_colnames argument |
meta_colnames |
chr, defaults to NULL, otherwise a character vector of
column names in |
categorical_features |
logical, defaults to FALSE, specifies whether X contains categorical features |
sample_cname |
chr, indicates which column contains sample ids |
outcome_cname |
chr, indicates which column contains the response variable or classification outcome |
pair_cname |
chr, (optional) indicates which column contains pairing information if the data are under a paired design |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | dontrun{
library(peppuR)
data('single_source')
data('multi_source')
x_multi = multi_source$X
y_multi = multi_source$Y
x_single = single_source$X
y_single = single_source$Y
sample_cname = 'ID'
outcome_cname = 'Group'
pair_cname = 'paircol'
result = as.MLinput(X = x_single, Y = y_single, categorical_features = T , sample_cname = sample_cname, outcome_cname = outcome_cname, pair_cname = pair_cname)
result2 = as.MLinput(X = x_multi, Y = y_multi, categorical_features = T, sample_cname = sample_cname, outcome_cname = outcome_cname, pair_cname = pair_cname)
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.