[R] Boxplot of multiple vectors with different lengths
sarah.goslee at gmail.com
Mon Dec 12 22:42:44 CET 2011
On Mon, Dec 12, 2011 at 4:24 PM, Ryan Utz <utz.ryan at gmail.com> wrote:
> I'm attempting to write a code that automatically imports data from
> different files (with different lengths-just one variable) and makes tidy
> box plots for comparison. I can successfully import the data and create a
> list of the vectors I want to compare. But I cannot, for the life of me,
> figure out how to generate box plots using the "list" option. Suppose these
> are my data:
> And this is my list of the vectors I'm interested in:
Did you look at z? You've made a list with a single element containing
 "a" "b" "c"
You need instead:
z <- list(a, b, c)
Also, don't call a variable c - that's a built-in function and using
the name elsewhere can cause all kinds of problems (look at your own
code line, where you use c as a function and as a variable. although
that wasn't a problem here).
> Well, this successfully generates the kind of boxplot I want:
> But this does not:
> Because I'm trying to write an automatic plot-generator as the amount of
> data I'm working with will typically vary, I need to write this to handle
> any number of data vectors.
> I've tried every imaginable means of tweaking the name of "z", with zero
> success. And I've scoured the help pages for about 45 minutes (just to
> preempt any "read the help" responses). Please help!
More information about the R-help