Hi I am new in R and was tring to convert dataframe into a time series object but after applying groupby on a certain index the datatype gets changed to "tbl_df" "tbl" "data.frame" format. Also i am trying to make a another dataframe subset out of an existing dataframe which is returning null. Also after converting the dataframe into a time series object its converting to ts matrix. Can you please let me know why all this issues are happening?
I have tried all the basic operations but somehow missing the background interpretation of all the codes used in the code. Kindly help
data <- read.csv("Time_Series_Data_Peak2.csv")
head(data)
class(data)
#Groupby
library(dplyr)
Dates_class = data %>%
group_by(Date) %>%
summarise(Dates_class= sum(Calls_Handled))
View(Dates_class)
head(Dates_class)
plot(Dates_class$Date,Dates_class$Dates_class)
lines(Dates_class$Date,Dates_class$Dates_class)
class(Dates_class)
Dates_class1 <- ts(Dates_class,start=c(2019,3),end=c(2019,5),frequency=1)
I want the data to be ready for checking stationarity.
Edit:
Sample data from the commment:
structure(list(Date = c("20/01/0003", "20/01/0003", "20/01/0003", "20/01/0003", "20/01/0003", "20/01/0003"), Date2 = structure(c(17956, 17956, 17956, 17956, 17956, 17956), class = "Date"), Calls_Handled = c(30L, 43L, 36L, 28L, 32L, 23L)), row.names = c(NA, 6L), class = "data.frame")
dput(head(data))
to the question in order to make your example reproducible – Robert