Reputation: 21
I would like to read a xlsx file into R, and create a tsibble object. It looks like this: https://docs.google.com/spreadsheets/d/119RXtTVJbHYeivorEtApbxQrLkLXolZdOc0kgCXFljQ/edit?usp=sharing
How can I do it ?
Upvotes: 0
Views: 880
Reputation: 311
Try this method:
library("openxlsx")
library("tsibble")
df <- data.frame(read.xlsx("Data.xlsx"))
tsibble <- as_tsibble(df, index = Date)
#Fuction to convert Date column to date format
tsibble$Date <- as.Date(tsibble$Date, origin = "1989-12-30")
Upvotes: 0