as.MLinput: Creates input for ML packages

Description Usage Arguments Examples

View source: R/as.MLinput.R

Description

This function creates an object that is ready to be used with peppuR package functions

Usage

1
2
as.MLinput(X, Y, meta_colnames = NULL, categorical_features = FALSE,
  sample_cname, outcome_cname, pair_cname = NULL)

Arguments

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 X that designate extra info e.g. outcome, pair as well as sample id

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

Examples

 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)

}

pmartR/peppuR documentation built on Jan. 17, 2020, 12:54 p.m.