比较时间属性
在 R 中,时间序列的起点和终点与其他日期或时间对象一样存储,这意味着您可以对它们进行比较测试,也可以通过算术运算来确定它们之间的时间间隔。
请运用您的 R 技能来操作 card_prices 的时间属性。该对象是某热门集换式卡牌游戏中一张卡的每日价格时间序列。
card_prices 时间序列,以及 zoo 和 lubridate 包,已为您准备好。
本练习是课程的一部分
R 中的时间序列数据处理
练习说明
将
card_prices的起点赋值给变量card_start。将
card_prices的终点赋值给变量card_end。用
card_end减去card_start,并查看结果。
交互式实操练习
通过完成这段示例代码来试试这个练习。
# Assign the start point to card_start
___
# Assign the end point to card_end
___
# Subtract the start point from the end point
___