Learn R Programming

lgr (version 0.2.0)

as.data.frame.LogEvent: Coerce LogEvents to Data Frames

Description

Coerce LogEvents to data.frames, data.tables, or tibbles.

Usage

# S3 method for LogEvent
as.data.frame(x, row.names = NULL, optional = FALSE,
  stringsAsFactors = default.stringsAsFactors(), strict = FALSE, ...)

as.data.table.LogEvent(x, ...)

as_tibble.LogEvent(x, ...)

Arguments

x

any R object.

row.names

NULL or a character vector giving the row names for the data frame. Missing values are not allowed.

optional

currently ignored

stringsAsFactors

logical: should the character vector be converted to a factor?

strict

If TRUE as.data.frame will fail if x contains values that cannot be included in a data.frame. Ff FALSE (the default) they will be coerced

...

passed on to data.frame()

See Also

data.table::data.table, tibble::tibble

Examples

Run this code
# NOT RUN {
l <- Logger$new("test")
l$info("lorem ipsum")
as.data.frame(l$last_event)

l$info("rememver LogEvents can store any custom log values", df = iris)
as.data.frame(l$last_event)
head(as.data.frame(l$last_event)$df[[1]])

# }

Run the code above in your browser using DataLab