[R] how to convert a list into a data frame.

PIKAL Petr petr.pikal at precheza.cz
Wed Sep 11 16:17:59 CEST 2013


Well as the original poster asks specifically how to convert imported list to data frame I assumed, maybe wrongly, that he/she knows R objects and by some tricky conversion managed to stuff Excel data to real list (class list) and not data.frame (class data frame).

But you are correct. Code, at least str(object) and detailed description of intention is vital here.

Petr


> -----Original Message-----
> From: Jeff Newmiller [mailto:jdnewmil at dcn.davis.CA.us]
> Sent: Wednesday, September 11, 2013 4:03 PM
> To: PIKAL Petr; Charles Thuo; r-help at r-project.org
> Subject: Re: [R] how to convert a list into a data frame.
> 
> But a data.frame is a special type of list, so you could both be right.
> The best way to communicate clearly about these questions is to provide
> reproducible example R code.
> -----------------------------------------------------------------------
> ----
> Jeff Newmiller                        The     .....       .....  Go
> Live...
> DCN:<jdnewmil at dcn.davis.ca.us>        Basics: ##.#.       ##.#.  Live
> Go...
>                                       Live:   OO#.. Dead: OO#..
> Playing
> Research Engineer (Solar/Batteries            O.O#.       #.O#.  with
> /Software/Embedded Controllers)               .OO#.       .OO#.
> rocks...1k
> -----------------------------------------------------------------------
> ----
> Sent from my phone. Please excuse my brevity.
> 
> PIKAL Petr <petr.pikal at precheza.cz> wrote:
> >How did you read it? Normally data from Excel are in data.frame
> >
> >Petr
> >
> >
> >> -----Original Message-----
> >> From: r-help-bounces at r-project.org [mailto:r-help-bounces at r-
> >> project.org] On Behalf Of Charles Thuo
> >> Sent: Wednesday, September 11, 2013 3:22 PM
> >> To: r-help at r-project.org
> >> Subject: [R] how to convert a list into a data frame.
> >>
> >> After reading a data set from excel into R it is of the type list.
> >How
> >> can such a list be converted into a data frame so as to attach the
> >> columns.
> >>
> >> Charles.
> >>
> >> 	[[alternative HTML version deleted]]
> >>
> >> ______________________________________________
> >> R-help at r-project.org mailing list
> >> https://stat.ethz.ch/mailman/listinfo/r-help
> >> PLEASE do read the posting guide http://www.R-project.org/posting-
> >> guide.html and provide commented, minimal, self-contained,
> >> reproducible code.
> >
> >______________________________________________
> >R-help at r-project.org mailing list
> >https://stat.ethz.ch/mailman/listinfo/r-help
> >PLEASE do read the posting guide
> >http://www.R-project.org/posting-guide.html
> >and provide commented, minimal, self-contained, reproducible code.



More information about the R-help mailing list