I want to create a stripchart of very simple experimental data: Six samples with three observations per sample. Here is the code I'm using.
pro<-c("Q","Q","Q",
"E","E","E",
"M","M","M",
"F","F","F",
"G","G","G",
"P","P","P"
); as.factor(pro)
ges<-c(1000,
1111,
2222,
1142,
1111,
1112,
400,
441,
544,
250,
200,
150,
101,
102,
103,
800,
900,
950
)
an <-data.frame(
pro,
rep=c(1,2,3,
1,2,3,
1,2,3,
1,2,3,
1,2,3,
1,2,3,
1,2,3,
1,2,3,
1,2,3,
1,2,3,
1,2,3,
1,2,3),
ges
);an; str(an)
stripchart(
ges~pro,data=an,vert=T,
pch=16,col="red",
ylab="y axis", xlab="x axis",
tck=.01,
)
I am 100 % happy with the stripchart in general. The only thing I want to change is the order. R keeps ordering my x values alphabetically, which is nonsense in this case because my experiment belongs in the order q-e-m-f-g-p. I've found similar topics, but all of them are so overly specific or use different packages like ggplot. There must be a simple way to force the original order of the vector?! It'd be great if someone could help me with this.
Many thanks in advance!