data.frame( ..., row.names, check.rows = F, check.names = T, na.strings = "NA")as.data.frame(object, ...) is.data.frame(object)
The treatment of objects appearing in a call depends on the existence of corresponding methods for as.data.frame(); see the discussion of argument object, and the note on methods below.
In the case of as.data.frame(), the single argument will be interpreted as a data frame. Columns of a matrix and elements of a list will become individual variables. Objects inheriting from "data.frame" will be returned as is, except that any classes preceding "data.frame" will be dropped, so that "data.frame" becomes the first class.
# two lists, taking one component as row names data.frame(car.specs, car.report[-1], row.names = "Model")# The following are roughly equivalent except for speed data.frame(scan("myfile",what=list(a=0,b=0,c="")) # Slow as.data.frame(scan("myfile",what=list(a=0,b=0,c="")) # Better read.table("myfile") # Best