1

I'm trying to make a really basic bar graph on 'R' and can't seem to get it to work. The data is just made up data for a proposal for an experiment we are going to do for my Animal Physiology paper at University. I just want a bar graph to show the number of days it take Drosophila larvae to hatch under different conditions.

Condition 1: 11 days
Condition 2: 11 days
Condition 3: 11 days
Condition 4: 10 days
Condition 5: 8 days
Condition 6: I don't expect to go anywhere so just do it as no days or something.

So I started by importing the data into Rcmdr.
Then I loaded the sciplot package and put in the code:

bargraph.CI (Treatment, Days, data = Bargraph, 
           xlab = "Condition", ylab = "Number of days")

And it came up with this error:

Warning in arrows(xvals, if (lc) CI.L else mn.data, xvals, if (uc) CI.H else mn.data,  :
  zero-length arrow is of indeterminate angle and so skipped
Warning in arrows(xvals, if (lc) CI.L else mn.data, xvals, if (uc) CI.H else mn.data,  :
  zero-length arrow is of indeterminate angle and so skipped
Warning in arrows(xvals, if (lc) CI.L else mn.data, xvals, if (uc) CI.H else mn.data,  :
  zero-length arrow is of indeterminate angle and so skipped
Warning in arrows(xvals, if (lc) CI.L else mn.data, xvals, if (uc) CI.H else mn.data,  :
  zero-length arrow is of indeterminate angle and so skipped
Warning in arrows(xvals, if (lc) CI.L else mn.data, xvals, if (uc) CI.H else mn.data,  :
  zero-length arrow is of indeterminate angle and so skipped
Warning in arrows(xvals, if (lc) CI.L else mn.data, xvals, if (uc) CI.H else mn.data,  :
  zero-length arrow is of indeterminate angle and so skipped
SlowLearner
  • 7,907
  • 11
  • 49
  • 80
Mark Gordon
  • 11
  • 1
  • 3
  • 2
    1. make a flatfile out of data. 2. Use Rstudio to load the data. 3. use barplot(your.data) – chupvl Aug 21 '13 at 11:33
  • 1
    They just seem to be warnings saying your confidence limits are of length 0, as there's no variability per condition – blmoore Aug 21 '13 at 11:39
  • 2
    If you add the data to the question somebody here will whip you up a plot in about 30 seconds. Suggest use of `dput` etc - check out [this post](http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example) for details. Oh, and welcome to Stack Overflow. PS this seems to your [second question](http://stackoverflow.com/questions/18350455/how-do-i-make-a-bar-graph-on-r-and-do-a-one-way-anova) of this type? Best not to double-post. Use [Cross Validated](http://stats.stackexchange.com/) for stats questions. – SlowLearner Aug 21 '13 at 11:42
  • @SlowLearner I suggested he split off this question from the previous one, to have on question per post. Now he only needs to change the content and title of the other question. – Paul Hiemstra Aug 21 '13 at 11:50

1 Answers1

1

I've had a similar problem when using plotmeans() to get confidence intervals about a mean. I've fixed the problem by reducing the point size by using windows(pointsize=1) to create a graphic device with a small point size, which effectively increases the resolution so small bars can now be plotted.

Unfortunately this makes all your other text too small, so you need to use functions like title() and axis(), with arguments like line, tck and their relevant cex arguments to adjust them.

You might also just try a larger device e.g. windows(width=20, height=20), but this won't always work.