Dear all,
This is my very first post and I am completely new to R (RGui), I deeply apologise if I am writing in the wrong place, section or even on the wrong website. I hope it's not!
I spend a few days trying to work out a way to solve the issue I've got, but I can't find a solution.
I am trying to use the anomalize package.
This requires to transform the data in tibble time.
After I've imported my data (.CSV), I have been able to transform them into tibble (tbl_df) but, if i try to convert them into tbl_time I get this message:
Error: Specified index
is not time based
I have tried to adjust the .CSV format (not sure if that is needed) changing the date format and the labels, but still... doesn't work!
I will paste what I've got, I am sure some of you will be able to help me. Thanks a lot!
This is part of the original dataset, as simple as monthly acquisition datapoints (gwt) and the acquisition date next to it (date)
date gwt
1 01/02/2003 01:21:18 0.41
2 01/03/2003 01:21:18 0.35
3 01/04/2003 01:21:18 0.22
4 01/05/2003 01:21:18 0.03
5 01/06/2003 01:21:18 -0.05
6 01/07/2003 01:21:18 -0.09
7 01/08/2003 01:21:18 -0.10
8 01/09/2003 01:21:18 -0.02
9 01/10/2003 01:21:18 0.04
10 01/11/2003 01:21:18 0.11
11 01/12/2003 01:21:18 0.08
12 01/01/2004 01:21:18 0.00
13 01/02/2004 01:21:18 -0.19
14 01/03/2004 01:21:18 -0.34
15 01/04/2004 01:21:18 -0.46
16 01/05/2004 01:21:18 -0.59
17 01/06/2004 01:21:18 -0.63
This is the tbl_df I've been able to obtain:
A tibble: 46 x 2
date gwt
1 01/02/2003 01:21:18 0.41
2 01/03/2003 01:21:18 0.35
3 01/04/2003 01:21:18 0.22
4 01/05/2003 01:21:18 0.03
5 01/06/2003 01:21:18 -0.05
6 01/07/2003 01:21:18 -0.09
7 01/08/2003 01:21:18 -0.1
8 01/09/2003 01:21:18 -0.02
9 01/10/2003 01:21:18 0.04
10 01/11/2003 01:21:18 0.11
... with 36 more rows
and this is the message i get when i try to get the tbl_time (as mentioned above):
t2 <- as_tbl_time(t1, date)
Error: Specifiedindex
is not time based
P.S. I've tried to change the format, removing the time and leaving the date only, but it doesn't make any difference.
Is anyone able to help? I'd much appreciate it
Sorry again for the long post apologise in advance for any mistake.
Kind regards,
Simone