split_dataset: split dataset in training and test set either by grouping...

View source: R/split_dataset.R

split_datasetR Documentation

split dataset in training and test set either by grouping vector or randomly

Description

split dataset in training and test set either by grouping vector or randomly

Usage

split_dataset(exprs, pheno, method = "random", prop = 0.25, grouping = NULL)

Arguments

exprs

non-negative numeric matrix with features as rows, and scRNA-Seq profiles as columns. 'ncol(sc.counts)' must equal 'nrow(sc.pheno)'

pheno

data frame with scRNA-Seq profiles as rows, and pheno entries in columns. 'nrow(sc.pheno)' must equal 'ncol(sc.counts)'

method

string specifying method of splitting; either 'random' (default) or 'predefined'

prop

numerical, fraction of profiles to be used as test set

grouping

factor with 2 levels (training == 1, test == 2), and 'length(grouping)' must be 'ncol(sc.counts)'. Assigns each scRNA-Seq profile to either test or train cohort.

Value

list containing two lists: 1) training 2) test both lists contain two entries: 1) exprs - non-negative numeric matrix with features as rows, and scRNA-Seq profiles as columns. 'ncol(sc.counts)' must equal 'nrow(sc.pheno)' 2) pheno - data frame with scRNA-Seq profiles as rows, and pheno entries in columns. 'nrow(sc.pheno)' must equal 'ncol(sc.counts)'


MarianSchoen/DMC documentation built on Aug. 2, 2022, 3:05 p.m.