Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
当我转换为 xts 对象时,R 将值从数字更改为字符串,这会导致问题:
timeseries <- xts(timeseries,as.POSIXct(timeseries$Date)) timeseries <- timeseries[endpoints(timeseries,ts_ret_freq)]
这是有问题的代码。为什么会这样?不应该。
提前致谢。
因为xts对象本质上是matrix对象。因此,xts 的所有列将始终具有相同的数据类型(类)
xts
matrix