2

This is my graph code, it's supposed to be high, medium, low but at the moment its high, low medium. Is there anything I can add to this to make it this way?

stripchart(data$Rel.abun.Chaemae ~ data$Shore.Position, 
           vertical = TRUE, 
           method = "jitter", 
           pch  = 21, 
           xlab = "Location",
           ylab = "Relative abundance (Chaemaesipho columna)", 
           ylim = c(0,1))
zx8754
  • 52,746
  • 12
  • 114
  • 209
  • 2
    `data$Shore.Position` might a class of factor? Change the factor levels and try to plot again. Also helpful to provide example data for testing: `dput(head(data))` – zx8754 May 06 '20 at 07:11

1 Answers1

1

Ensure that Shore.Position is a factor. If not, set it as factor.

str(data$Shore.Position)
data$Shore.Position <- factor(data$Shore.Position)

Then, change the order of levels as below and plot.

data$Shore.Position <- factor(data$Shore.Position, levels = c("high", "medium", "low"))
Mohanasundaram
  • 2,889
  • 1
  • 8
  • 18