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 时间序列对象中的第一个或最后一个条目的年份作为字符串获取?在这个 AAPL 时间序列的例子中?
require(quantmod) getSymbols("AAPL")
首次入境年份....
format(index(first(AAPL)),"%Y")
最后进入的年份...
format(index(last(AAPL)),"%Y")