| as.data.frame.I {mvbutils} | R Documentation |
as.data.frame.I(x) protects all columns in x, except factors and numerics, using I() before calling as.data.frame(x).
as.data.frame.I( x, row.names=NULL, optional=FALSE, ...)
As per as.data.frame.
x |
a list |
row.names |
NULL or a character vector giving the row names for the data frame. Missing values are not allowed. |
optional |
logical. If TRUE, setting row names and converting column names (to syntactic names) is optional. |
... |
passed to as.data.frame after protecting columns. |
A data.frame with the same columns as x.
class( as.data.frame( list( x=letters[1:3]))$x) # factor mode( as.data.frame( list( x=letters[1:3]))$x) # numeric class( as.data.frame.I( list( x=letters[1:3]))$x) # AsIs mode( as.data.frame.I( list( x=letters[1:3]))$x) # character