Wrapper around as.data.frame. In contrast it sets stringsAsFactors=FALSE and allows to pass a vectors of column names.

as_data_frame(x, col.names = NULL, ...)

Arguments

x

[object]
Any R object that can be coerced into a data frame.

col.names

[character | NULL]
Optional character vector of column names.

...

[any]
Further arguments passed down to as.data.frame.

Value

A data frame.

Examples

x = list(a = 1:2, b = c("K", "L")) y = as_data_frame(x, col.names = c("C1", "C2"))