我试图如下图所示绘制x与y的关系
test1 <- data.frame(x = c(26, 21, 20), y = c("a", "b", "c"))
plot(test1$y,test1$x)
但是我得到以下错误。我该如何处理?
Error in plot.window(xlim, ylim, log = log, ...) :
NAs not allowed in 'xlim'
In addition: Warning messages:
1: In mean.default(width) :
argument is not numeric or logical: returning NA
2: In Ops.factor(width, 2) : ‘/’ not meaningful for factors
3: In Ops.factor(space, width) : ‘+’ not meaningful for factors
4: In Ops.factor(width, 2) : ‘/’ not meaningful for factors
5: In Ops.factor(space, width) : ‘+’ not meaningful for factors