makeDataFrame: Converts 'tbl' or 'data.table' objects to plain 'data.frames'...

View source: R/makeDataFrame.r

makeDataFrameR Documentation

Converts tbl or data.table objects to plain data.frames for internal processing

Description

Function is mainly used for internal checks in the eatRep and eatModel package: objects which expected to be data.frames for further processing are converted to data.frame when their class is tbl, for example.

Usage

makeDataFrame (dat, name = "dat", minRow = 1, onlyWarn=TRUE)

Arguments

dat

An object which is intended to be a data.frame.

name

Optional: name of data.frame for use in messages

minRow

When used internally, function report when data.frame has less rows than specified in minRow.

onlyWarn

If TRUE, function warns if data.frame has less rows than specified in minRow. Otherwise, functions aborts with an error message.

Value

data frame.

Examples

dat  <- data.table::data.table(x1 = 1:5, y1 = letters[1:5])
# unexpected in 'classical' data frames
class(dat[,"x1"])
dat  <- makeDataFrame(dat)

eatTools documentation built on Nov. 23, 2023, 5:06 p.m.