【发布时间】:2018-02-22 11:25:28
【问题描述】:
在运行 spline 方法后,我正在运行 loess.smooth 方法。 下面给出的输入是我运行样条方法后得到的数据。 但是我在 loess.smooth 方法上出错了。整个第一列以浮点格式返回输出,但我需要它以整数格式,增量为 1。
任何帮助将不胜感激。
谢谢
**input:** spline_file
1 0.157587435
2 0.146704412
3 0.129899285
4 0.138925582
5 0.104085676
out <- loess.smooth(spline_file$x, spline_file$y, span = 1, degree = 1,
family = c("gaussian"), length.out = seq(1, max_exp, by = 1), surface=
"interpolate", normalize = TRUE, method="linear")
**OUTPUT:**
0 0.150404703
1.020408163 0.154413716
2.040816327 0.158458172
3.06122449 0.162515428
4.081632653 0.166562839
5.102040816 0.170577762
**OUTPUT REQUIRED:**
x y
1 0.225926707
2 0.226026551
3 0.226241194
4 0.2265471
5 0.226920733
【问题讨论】: