【发布时间】:2018-10-06 00:03:37
【问题描述】:
尝试在 R 中创建散点图时收到错误消息。我的教授在使用相同的数据集和相同的代码时没有收到此错误消息。我重新安装了 R、RStudio 和所有 R 包,但没有成功。情节看起来不错,所以我不明白为什么会抛出这些错误。
由于我正在使用 RMarkdown(不在此特定代码 sn-p 中,但我想将此图包含在 RMarkdown 文件中),错误消息与图表一起出现在 RMarkdown 输出中,我想删除这些输出中的错误消息,使其看起来很干净。
数据集取自https://wps.pearsoned.co.uk/wps/media/objects/12401/12699039/datasets3e/datasets/caschool.xlsx。
我将不胜感激任何提示(1)抑制警告消息,因为情节实际上看起来不错(2)或解决潜在问题。当然,选项 (2) 会更好。
library(readxl)
caschool <- read_excel("../dataStockWatson15/caschool.xlsx")
library(car)
scatterplot(testscr~str, reg.line=FALSE, smooth=FALSE, spread=FALSE, boxplots=FALSE, span=0.5, ellipse=FALSE, levels=c(.5, .9), data=caschool)
warnings()
警告:
Warning messages:
1: In plot.window(...) : "reg.line" is not a graphical parameter
2: In plot.window(...) : "spread" is not a graphical parameter
3: In plot.window(...) : "span" is not a graphical parameter
4: In plot.window(...) : "levels" is not a graphical parameter
5: In plot.xy(xy, type, ...) : "reg.line" is not a graphical parameter
6: In plot.xy(xy, type, ...) : "spread" is not a graphical parameter
7: In plot.xy(xy, type, ...) : "span" is not a graphical parameter
8: In plot.xy(xy, type, ...) : "levels" is not a graphical parameter
9: In axis(side = side, at = at, labels = labels, ...) :
"reg.line" is not a graphical parameter
10: In axis(side = side, at = at, labels = labels, ...) :
"spread" is not a graphical parameter
11: In axis(side = side, at = at, labels = labels, ...) :
"span" is not a graphical parameter
12: In axis(side = side, at = at, labels = labels, ...) :
"levels" is not a graphical parameter
13: In axis(side = side, at = at, labels = labels, ...) :
"reg.line" is not a graphical parameter
14: In axis(side = side, at = at, labels = labels, ...) :
"spread" is not a graphical parameter
15: In axis(side = side, at = at, labels = labels, ...) :
"span" is not a graphical parameter
16: In axis(side = side, at = at, labels = labels, ...) :
"levels" is not a graphical parameter
17: In box(...) : "reg.line" is not a graphical parameter
18: In box(...) : "spread" is not a graphical parameter
19: In box(...) : "span" is not a graphical parameter
20: In box(...) : "levels" is not a graphical parameter
21: In title(...) : "reg.line" is not a graphical parameter
22: In title(...) : "spread" is not a graphical parameter
23: In title(...) : "span" is not a graphical parameter
24: In title(...) : "levels" is not a graphical parameter
There were 48 warnings (use warnings() to see them)
【问题讨论】:
标签: r plot r-markdown