make_dt: make_dt

Description Usage Arguments Value Examples

View source: R/functions_make.R

Description

Creates a data.table from a vector of files.

Usage

1
make_dt(files, group_lev = NULL, max_name_len = 30)

Arguments

files

character vector of file paths.

group_lev

If provided, should be directory names at equivalent depth in file paths. Default of NULL disables this functionality and group will be none and batch will be A.

max_name_len

Names are truncated to this length. Default is 30.

Value

A data.table with attribute "file" and "name", "group", and "batch" attributes.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
files = c("exp1/file1", "exp1/file2", "exp2/file3")
#default no group levels
make_dt(files)
dt1 = make_dt(files, group_lev = c("exp1", "exp2"))
levels(dt1$group)
dt1$batch
#reversed group_lev
dt2 = make_dt(files, group_lev = rev(c("exp1", "exp2")))
levels(dt2$group)
dt2$batch

jrboyd/seqqc documentation built on March 20, 2021, 2:04 p.m.