Please explain to me how
df <- data.frame(x, y, index = 1:10)
qplot(index, x, geom = 'line', ...)
is 'very restrictive'. Lattice and ggplot2 are *structured* graphics systems
- to get the gains that they provide, there are some costs. I don't perceive
organization of data into a data frame as being restrictive - in fact, if
you learn how to construct data for input into ggplot2 to simplify the code
for labeling variables and legends, the data frame requirement is actually a
benefit rather than a restriction. Moreover, one can use the plyr and
reshape(2) packages to reshape or condense data frames to provide even more
flexibility and freedom to produce ggplot2 and lattice graphics. In
addition, the documentation for ggplot2 is quite explicit about requiring
data frames for input, so it is behaving as documented. The complexity (and
interaction) of the graphics code probably has something to do with that.
Since Josh left you a quote, I'll supply another, from Prof. Steve Vardeman
in a class I took with him a long time ago:
"There is no free lunch in statistics: in order to get something, you've got
to give something up."
In this case, if you want the nice infrastructure provided by ggplot2, you
have to create a data frame for input.
Dennis
Thanks in advance, and best regards!
Eduardo Horta
? ? ? ?[[alternative HTML version deleted]]