lgr (version 0.3.3)

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 = 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 and only included for compatibility.

stringsAsFactors

logical scalar: should character vectors be converted to factors? Defaults to FALSE (as opposed to base::as.data.frame()) and is only included for compatibility.

...

passed on to data.frame()

See Also

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

Examples

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

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

Run the code above in your browser using DataLab