I have a tsibble with the following variables. Making a reprex of it changes the data type of month to be character. But otherwise, it is of data type month.
df <- data.frame(
month = c("2012 Jan","2012 Feb","2012 Mar",
"2012 Apr","2012 May","2012 Jun","2012 Jul","2012 Aug",
"2012 Sep","2012 Oct","2012 Nov","2012 Dec"),
volume = c(1558933,1392161,1703372,1443328,
1680644,1591807,1388084,1496928,1640968,1692362,1855691,
1941984)
)
# Data type of "month" in original data as mnth
df <- df%>%
mutate(month = yearmonth(month))%>%
as_tsibble(index = month)
I want to have volumes by year and I am not able to use group_ by in this tsibble for some reason
How can I add commas in the values of volume. I can also add commas after saving into .xlsx as shown below. But I am not sure how can I do that?