Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
R で使用plotすると、x 軸の因子がアルファベット順に並べられます。
plot
x 軸の要素の順序を指定するにはどうすればよいですか?
例:
y <- 1:9 x <- c(rep("B", 3), rep("A", 3), rep("C", 3)) plot(y ~ as.factor(x))
これにより、次の結果が得られます。
これを「B」、「A」、「C」としてプロットするにはどうすればよいですか?