r - How do you combine multiple boxplots from a List of data-frames? -
this repost statistics portion of stack exchange. had asked question there, advised ask question here. here is.
i have list of data-frames. each data-frame has similar structure. there 1 column in each data-frame numeric. because of data-requirements essential each data-frame has different lengths. want create boxplot of numerical values, categorized on attributes in column. boxplot should include information data-frames.
i hope clear question. post sample data soon.
sam,
i'm assuming follow this question? maybe sample data illustrate nuances of needs better (the "categorized on attributes in column" part), same melting
approach should work here.
library(ggplot2) library(reshape2) #fake data <- data.frame(a = rnorm(10)) b <- data.frame(b = rnorm(100)) c <- data.frame(c = rnorm(1000)) #in list mylist <- list(a,b,c) #in melting pot df <- melt(mylist) #separate boxplots each data.frame qplot(factor(variable), value, data = df, geom = "boxplot") #all values plotted 1 boxplot qplot(factor(1), value, data = df, geom = "boxplot")
Comments
Post a Comment