-----Original Message-----
From: Marc Schwartz [mailto:[EMAIL PROTECTED]
Sent: Friday, 14 November 2003 9:44 AM
To: Paul Sorenson
Cc: [EMAIL PROTECTED]
Subject: RE: [R] xlims of barplot


>On Thu, 2003-11-13 at 15:53, Paul Sorenson wrote:
>
>SNIP
>
>> Sorry for being vague, it is the latter case, vertical bars.  The data
>> doesn't satisfy condition 1.  The family of 6 plots is datestamped data,
>> the first plot showing all defects, then each subsequent plot showing
>> defects of each severity level we define.  The min and max of each of the
>> subsequent datasets is in general a subset of the full dataset.  I can
>> easily plot them but it would be nice to keep the same x limits on each
>> graph.  The x data is POSIXct although I suspect that is not relevant.
>
>
>OK...I think I understand what you are doing.
>
>You want a series of barplots that have "space" for the same number of
>vertical bars along the x axis, but there may be gaps in the series for
>any given barplot. Presumably, those gaps may be anywhere in the time
>series along the x axis.

Correct and most problematically at the ends.

>Hint: barplot() will leave gaps in the bar series where an NA appears in
>the vector or in a matrix column of height values.
>
>...
>
>So, the key is to be sure that the vector or matrix has the same number
>of elements or matrix columns in each dataset. For your incomplete
>datasets, pad each series with NA's to fill out the missing entries in
>the time series.

That sounds like a way forward.  I just need to go back to the basics and
learn how to add "rows" to data.frames.  I am sure it won't be hard, its
just my personal learning curve with several new data types (factors,
tables, data.frames vs vectors, lists, arrays which I am more familiar
with).  For example, yesterday I tried max(myFactor) and it gave me an
error (something like "must be a vector"), even though to my naive way of
thinking myFactor clearly had a numeric max.

Thanks



        [[alternative HTML version deleted]]

______________________________________________
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help

Reply via email to