I have a series of data which is managed through a loop. The loop creates
"pivot tables" of my data using the *cast* function in the
*reshape*library. For the most part, the data is all plotted
correctly.
Unfortunately, there are a couple of data sets which create errors and halt
the loop.

One of the tables looks like the following:

  dbh Black Walnut
1   8     38.19722
2  10     48.89244
3  12     38.19722

When the loop attempts the barplot() function, the following error is
returned:
Error in seq_len(p) : argument must be coercible to non-negative integer

In other cases, there is simply no data in the specified set of data.
Therefore, the table is full of NA's. Obviously, this does not need to be
plotted, but I cannot simply remove it from the larger database. I need my
loop to continue regardless of if it runs into these issues.

*Question: What can I do to ensure the above single variable table will
plot correctly? and what can I do to suppress errors on the datasets which
do not have data so the loop continues?*

full code: http://pastebin.com/LB88hpfM

Thank you in advance.

--
all the best,
Lee Mueller
ISA Certified Arborist MI-4148A
Registered Forester #46043

	[[alternative HTML version deleted]]

