全部版块 我的主页
论坛 数据科学与人工智能 数据分析与数据科学 R语言论坛
6922 11
2015-02-17
在scatterplot函数中,lty.smooth到底是不是一个函数的参数,为什么运行时R总是报错?请各位指点,谢谢~
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

全部回复
2015-3-2 15:32:12
这个函数全套的应该是——
panel.Stratiplot(x, y,
                 type = "l",
                 col,
                 pch = plot.symbol$pch,
                 cex = plot.symbol$cex,
                 col.line = plot.line$col,
                 col.symbol = plot.symbol$col,
                 col.refline = ref.line$col,
                 col.smooth = "red",
                 col.poly = plot.line$col,
                 lty = plot.line$lty,
                 lwd = plot.line$lwd,
                 lty.smooth = plot.line$lty,
                 lwd.smooth = 2,
                 fill = plot.symbol$fill,
                 zones = NULL,
                 col.zones = plot.line$col,
                 lty.zones = plot.line$lty,
                 lwd.zones = plot.line$lwd,
                 gridh = -1, gridv = -1,
                 ...)  


lty.smooth:line type for the loess smoother.The default is obtained from plot.line using trellis.par.get.

不过具体的还要看你报的什么错
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2015-3-3 10:48:14
DM小菜鸟 发表于 2015-3-2 15:32
这个函数全套的应该是——
panel.Stratiplot(x, y,
                 type = "l",
恩,我等下试试,再交流,谢谢
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2015-12-2 19:13:27
> scatterplot(yeild~N,data=ndata,lty.smooth=2,spread=FALSE,pch=19)
Warning messages:
1: In plot.window(...) : "lty.smooth" is not a graphical parameter
2: In plot.xy(xy, type, ...) : "lty.smooth" is not a graphical parameter
3: In axis(side = side, at = at, labels = labels, ...) :
  "lty.smooth" is not a graphical parameter
4: In axis(side = side, at = at, labels = labels, ...) :
  "lty.smooth" is not a graphical parameter
5: In box(...) : "lty.smooth" is not a graphical parameter
6: In title(...) : "lty.smooth" is not a graphical parameter
请教这是什么原因
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2016-6-3 14:29:36
似海 发表于 2015-12-2 19:13
> scatterplot(yeild~N,data=ndata,lty.smooth=2,spread=FALSE,pch=19)
Warning messages:
1: In plot.wi ...
请问后来是怎么解决了的呢?谢谢
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2016-7-17 11:00:17
fiona_93 发表于 2016-6-3 14:29
请问后来是怎么解决了的呢?谢谢
scatterplot(x, y,
         smoother=loessLine, smoother.args=list(), smooth, span,
         spread=!by.groups, reg.line=lm,
         boxplots=if (by.groups) "" else "xy",
         xlab=deparse(substitute(x)), ylab=deparse(substitute(y)), las=par("las"),
         lwd=1, lty=1,
         labels, id.method = "mahal",
         id.n = if(id.method[1]=="identify") length(x) else 0,
         id.cex = 1, id.col = palette()[1],
         log="", jitter=list(), xlim=NULL, ylim=NULL,
         cex=par("cex"), cex.axis=par("cex.axis"), cex.lab=par("cex.lab"),
         cex.main=par("cex.main"), cex.sub=par("cex.sub"),
         groups, by.groups=!missing(groups),
         legend.title=deparse(substitute(groups)), legend.coords, legend.columns,
         ellipse=FALSE, levels=c(.5, .95), robust=TRUE,
         col=if (n.groups == 1) palette()[3:1] else rep(palette(), length=n.groups),
         pch=1:n.groups,
         legend.plot=!missing(groups), reset.par=TRUE, grid=TRUE, ...)
请注意scatterplot()函数的红色字体部分!!!
smoother=loessLine表示光滑曲线由loessLine()函数(该函数具体信息参见“?ScatterplotSmoothers”命令下的帮助文档)绘制
而smoother.args=list()则规定了光滑曲线的其它参数,

而loessLine()函数的默认参数为:
smoother.args=list(lty=1,lwd=2, lty.spread=2, lwd.spread=1, span=0.5, degree=2,
                           family="symmetric", iterations=4)
#lty.spread和lwd.spread指定了spread=TRUE时添加线条的类型和宽度。

所以lty.smooth=2的命令可由smoother.args=list(lty=2)来实现。

> scatterplot(yeild~N,data=ndata,lty.smooth=2,spread=FALSE,pch=19)
可修改为> scatterplot(yeild~N,data=ndata,smoother.args=list(lty=2),spread=FALSE,pch=19)
其它的像scatterplotMatrix()函数亦是如此。
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

点击查看更多内容…
相关推荐
栏目导航
热门文章
推荐文章

说点什么

分享

扫码加好友,拉您进群
各岗位、行业、专业交流群