R: Creating a boxplot from List of data lists that contain data
2
0
Entering edit mode
8.7 years ago

Hello All,

I am trying to create a boxplot in R. Simple enough, but my data fame is a 1) A list that contains 2) 8 lists of which 3) each list contains 18-24 data points. I am trying to get all of the data into one boxplot.

Is that possible and is there a way of doing it either by 1) passing in the entire data frame or 2) splitting the lists into separate units.

Thanks to all in advance!

Best,

Erika

R boxplot • 5.7k views
ADD COMMENT
0
Entering edit mode
8.7 years ago
mastal511 ★ 2.1k

I'm not sure that I understand what you're trying to do, but it sounds like you need to concatenate the columns of your data.frame into a one-dimensional vector, then you can produce one plot from all the data points.

ADD COMMENT
0
Entering edit mode
8.7 years ago

Look into running unlist() on your lists of lists until you get a flat vector of datapoints that you can pour into a boxplot container. If you add the recursive = TRUE option, you probably wouldn't have to do more than one pass, unless you need a subset.

ADD COMMENT

Login before adding your answer.

Traffic: 1641 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6