# Working with Time Series Data

Dear R community,

i´m very thankful for the help I already got. I have some more problems with my analysis of energy-data from germany.

I try to investigate the so called "Regelzonensaldo". I succesful transformed with the help of the community and the lubridate package the data in a xts format.

Modified_Gesamt_Regelzonensaldonew <- Gesamt_Regelzonensaldonew %>%
mutate(dttm = mdy_hm(paste(Date, Time)),
Date = mdy(Date),
Time = hm(Time))

Modified_Gesamt_Regelzonensaldonew\$Date <- NULL
Modified_Gesamt_Regelzonensaldonew\$Time <- NULL

Modified2_Gesamt_Regelzonensaldonew<-Modified_Gesamt_Regelzonensaldonew[c("dttm","Betr.")]
Modified3_XTS_Gesamt_Regelzonensaldonew<-xts(Modified2_Gesamt_Regelzonensaldonew[,-1], order.by=Modified2_Gesamt_Regelzonensaldonew[,1])

![XTS|360x430]

I want to illustrate for example the deviation of the times series. The problem starts with the creating of absolute values.

Modified4_XTS_abs_Gesamt_Regelzonensaldonew<-abs(Modified3_XTS_Gesamt_Regelzonensaldonew)

The result ist: not-numerical argument for mathematical function.

Modified5_XTS_abs_Monthly_sum_Gesamt_Regelzonensaldonew <- apply.monthly(Modified4_XTS_abs_Gesamt_Regelzonensaldonew, sum)
Modified5_XTS_abs_Monthly__mean_Gesamt_Regelzonensaldonew <- apply.monthly(Modified4_XTS_abs_Gesamt_Regelzonensaldonew, mean)

autoplot(Modified4_XTS_abs_Gesamt_Regelzonensaldonew)

Another problem is that i can´t do functions like

Mean()
Var()

on my time series data. Maybe it is because i deleted the column names?

I hope the questions aren´t to trivial and not already answered but I tried for hours my best to solve it and can´t figure it out. I hope somebody can help me.

Friendly regards from Germany

Felix

Hi!

To help us help you, could you please prepare a reproducible example (reprex) illustrating your issue? Please have a look at this guide, to see how to create one:

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.