Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/r/72.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
R 按绘图顺序排列的行_R_Ggplot2_Visualization - Fatal编程技术网

R 按绘图顺序排列的行

R 按绘图顺序排列的行,r,ggplot2,visualization,R,Ggplot2,Visualization,从库mgcv 我得到了要绘制的点: fsb <- fs.boundary(r0=0.1, r=1.1, l=2173) 我现在尝试使用ggplot(这是更大代码中的一行): tpdf您必须指定group参数-例如 ggplot(tpdf) + geom_point(aes(ts, ps)) + geom_line(aes(ts, ps, group = gl(4, 40))) 给我一个类似于R基的图。 这可以通过使用几何路径来解决: ggplot(tpdf)+ geom

从库
mgcv
我得到了要绘制的点:

fsb <- fs.boundary(r0=0.1, r=1.1, l=2173)

我现在尝试使用ggplot(这是更大代码中的一行):


tpdf您必须指定
group
参数-例如

ggplot(tpdf) + 
  geom_point(aes(ts, ps)) +
  geom_line(aes(ts, ps, group = gl(4, 40)))
给我一个类似于R基的图。

这可以通过使用
几何路径来解决:

ggplot(tpdf)+
  geom_point(aes(ts,ps)) +
  geom_path(aes(ts,ps))

您使用
ggplot
的方式非常奇怪,我建议您重新检查一下

数据:

库(mgcv)
金融稳定委员会
ggplot(tpdf) + 
  geom_point(aes(ts, ps)) +
  geom_line(aes(ts, ps, group = gl(4, 40)))
ggplot(tpdf)+
  geom_point(aes(ts,ps)) +
  geom_path(aes(ts,ps))
library(mgcv)
fsb <- fs.boundary(r0 = 0.1, r=2, l=13)
tpdf <- data.frame(ts=fsb$x,ps=fsb$y)