1
r多個屬性的支持在R TS封裝的時間序列
pol_pos = ts(p$POS, frequency = 12, start = c(2017,8))
,但我需要使用數據的多個屬性,如
pol_pos = ts(p$POS, p$NEG, frequency = 12, start = c(2017,8))
有沒有辦法做到這一點?
r多個屬性的支持在R TS封裝的時間序列
pol_pos = ts(p$POS, frequency = 12, start = c(2017,8))
,但我需要使用數據的多個屬性,如
pol_pos = ts(p$POS, p$NEG, frequency = 12, start = c(2017,8))
有沒有辦法做到這一點?
當然。第一個參數需要是多列對象:
pol_pos=ts(p[, c("POS", "NEG")], frequency = 12, start = c(2017,8))
@arun您好,非常歡迎您。如果您發現這個答案有用,請點擊我答案的分數下方的複選標記,接受我的答案。 – lebelinoz
謝謝你的回答 – arun