点线结构参数
在plot函数中,使用参数type来控制点线输出结构。
参数取值 | 描述 |
---|---|
type = “p” | 点 |
type = “l” | 线 |
type = “b” | 点连线 |
type =“o” | 线穿过点 |
type =“h” | 悬垂线 |
type = “s” | 阶梯线 |
操作示例
# 时序图
yield <- c(15.2, 16.9, 15.3, 14.9, 15.7, 15.1, 16.7)
yield <- ts(yield, start = 1884)# 指定yield为时间序列变量,start指定序列的起始读入时间,frequency选项指定序列每年读入的数据频率。如果不写频率的话,默认为1年。
yield
plot(yield)
# 散点图
plot