使用绘图功能时收到警告消息

Getting warning message while using plot function

我有我的数据库 table,我从中检索列并使用 plot 函数绘制它。

这是 table

的专栏
 Profit
 1   21200                    
 2   28000
 3   29600
 4   30200
 5   33000
 6   26800
 7   32600
 8   30000
 9   28000
10  34000

这里有 60 行,但我只显示了 10 行。 当我尝试绘制图表时,我得到一条平行于 x 轴的直线,但这里的利润在变化,所以我认为它不应该平行于 x-axis.Since table 存在于数据库中在 aws 中,我首先从 table 中检索利润列,然后使用 plot function.Here 进行绘图是 plot function

 choices = dbGetQuery(pool,"select Profit from input11;")

plot(Choices, type = "l", lwd = 3, main = "Profit",col = "green", xlab = 
"Number of Overbooking", ylab = "Profit")

我也在这里收到警告消息:

 Warning messages:
1: In plot.window(xlim, ylim, log, ...) :
  graphical parameter "type" is obsolete
2: In axis(side = side, at = at, labels = labels, ...) :
 graphical parameter "type" is obsolete
3: In title(xlab = xlab, ylab = ylab, ...) :
  graphical parameter "type" is obsolete

但是当我删除 type = "l" 时,警告消息消失了。但我只想要直线格式的情节。

基于这个R Help threadProfit列是class的因子,我们来测试一下:

以下工作正常,当数字:

plot(1:10, type = "l")

当我们有因子、绘图但有警告时:

plot(factor(1:10), type = "l")

Warning messages:
1: In plot.window(xlim, ylim, log = log, ...) :
  graphical parameter "type" is obsolete
2: In axis(if (horiz) 2 else 1, at = at.l, labels = names.arg, lty = axis.lty,  :
  graphical parameter "type" is obsolete
3: In title(main = main, sub = sub, xlab = xlab, ylab = ylab, ...) :
  graphical parameter "type" is obsolete
4: In axis(if (horiz) 1 else 2, cex.axis = cex.axis, ...) :
  graphical parameter "type" is obsolete