Skip to content
Prev 388613 / 398502 Next

Converting a list to a data frame

Duncan

I need to plot the results (ggplot2) and I'm thinking I can only use a data.frame object in ggplot2. It is a rath r large "list" over 1 million rows. It is possible to work with a matrix in ggplot2?

Jeff

-----Original Message-----
From: Duncan Murdoch <murdoch.duncan at gmail.com> 
Sent: Saturday, July 24, 2021 12:03 PM
To: reichmanj at sbcglobal.net; R-help at r-project.org
Subject: Re: [R] Converting a list to a data frame

Others have shown you how to extract the matrix and convert it to a dataframe.  My only addition is to suggest that you don't do this: 
matrix methods are often much more efficient than dataframe methods, so if you can work with the matrix without conversion, you'll often find things run a lot faster.

Duncan Murdoch
On 24/07/2021 9:18 a.m., Jeff Reichman wrote: