This is a test version of Biostars. For the public version, visit https://www.biostars.org.
R: Creating a boxplot from List of data lists that contain data

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

2 answers

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.

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.

Log in to answer this question.