make_dt: make_dt

View source: R/functions_make.R

make_dtR Documentation

make_dt

Description

Creates a data.table from a vector of files.

Usage

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

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

FrietzeLabUVM/ssvQC documentation built on March 25, 2024, 12:24 a.m.