Hello,
I am tyring to plot a graph using ggplot.
This is my data:
date quits open hires
1 2016-01-01 00:00:00 0 0 0
2 2016-02-01 00:00:00 20 -18.2 -4.00
3 2016-03-01 00:00:00 20 -10.9 -8.00
4 2016-04-01 00:00:00 20 -10.9 -12
5 2016-05-01 00:00:00 20 -9.09 -16
6 2016-06-01 00:00:00 26.7 -10.9 -16
7 2016-07-01 00:00:00 20 -7.27 -24
8 2016-08-01 00:00:00 13.3 -12.7 -12
9 2016-09-01 00:00:00 26.7 -10.9 -20
10 2016-10-01 00:00:00 20 -1.82 -8.00
... with 57 more rows
data_long
date variable value
1 2016-01-01 quits 0.000000
2 2016-02-01 quits 20.000000
3 2016-03-01 quits 20.000000
4 2016-04-01 quits 20.000000
5 2016-05-01 quits 20.000000
6 2016-06-01 quits 26.666667
7 2016-07-01 quits 20.000000
8 2016-08-01 quits 13.333333
9 2016-09-01 quits 26.666667
10 2016-10-01 quits 20.000000
11 2016-11-01 quits 13.333333
12 2016-12-01 quits 20.000000
13 2017-01-01 quits 33.333333
14 2017-02-01 quits 20.000000
15 2017-03-01 quits 26.666667
16 2017-04-01 quits 26.666667
17 2017-05-01 quits 26.666667
18 2017-06-01 quits 26.666667
19 2017-07-01 quits 20.000000
20 2017-08-01 quits 13.333333
21 2017-09-01 quits 20.000000
22 2017-10-01 quits 26.666667
23 2017-11-01 quits 20.000000
24 2017-12-01 quits 20.000000
25 2018-01-01 quits 6.666667
26 2018-02-01 quits 13.333333
27 2018-03-01 quits 26.666667
28 2018-04-01 quits 26.666667
29 2018-05-01 quits 46.666667
30 2018-06-01 quits 40.000000
31 2018-07-01 quits 33.333333
32 2018-08-01 quits 46.666667
33 2018-09-01 quits 26.666667
34 2018-10-01 quits 40.000000
35 2018-11-01 quits 40.000000
36 2018-12-01 quits 46.666667
37 2019-01-01 quits 40.000000
38 2019-02-01 quits 40.000000
39 2019-03-01 quits 46.666667
40 2019-04-01 quits 33.333333
41 2019-05-01 quits 20.000000
42 2019-06-01 quits 20.000000
43 2019-07-01 quits 40.000000
44 2019-08-01 quits 33.333333
45 2019-09-01 quits 26.666667
46 2019-10-01 quits 33.333333
47 2019-11-01 quits 26.666667
48 2019-12-01 quits 40.000000
49 2020-01-01 quits 40.000000
50 2020-02-01 quits 40.000000
51 2020-03-01 quits 33.333333
52 2020-04-01 quits 26.666667
53 2020-05-01 quits 6.666667
54 2020-06-01 quits 40.000000
55 2020-07-01 quits 53.333333
56 2020-08-01 quits 40.000000
57 2020-09-01 quits 46.666667
58 2020-10-01 quits 60.000000
59 2020-11-01 quits 33.333333
60 2020-12-01 quits 40.000000
61 2021-01-01 quits 46.666667
62 2021-02-01 quits 40.000000
63 2021-03-01 quits 53.333333
64 2021-04-01 quits 66.666667
65 2021-05-01 quits 60.000000
66 2021-06-01 quits 66.666667
67 2021-07-01 quits 73.333333
68 2016-01-01 open 0.000000
69 2016-02-01 open -18.181818
70 2016-03-01 open -10.909091
71 2016-04-01 open -10.909091
72 2016-05-01 open -9.090909
73 2016-06-01 open -10.909091
74 2016-07-01 open -7.272727
75 2016-08-01 open -12.727273
76 2016-09-01 open -10.909091
77 2016-10-01 open -1.818182
78 2016-11-01 open -1.818182
79 2016-12-01 open -1.818182
80 2017-01-01 open -3.636364
81 2017-02-01 open -1.818182
82 2017-03-01 open -9.090909
83 2017-04-01 open -9.090909
84 2017-05-01 open -10.909091
85 2017-06-01 open -3.636364
86 2017-07-01 open -9.090909
87 2017-08-01 open -5.454545
88 2017-09-01 open -9.090909
89 2017-10-01 open -9.090909
90 2017-11-01 open -10.909091
91 2017-12-01 open -7.272727
92 2018-01-01 open -9.090909
93 2018-02-01 open -5.454545
94 2018-03-01 open -3.636364
95 2018-04-01 open -1.818182
96 2018-05-01 open -3.636364
97 2018-06-01 open -1.818182
98 2018-07-01 open -3.636364
99 2018-08-01 open -3.636364
100 2018-09-01 open 3.636364
101 2018-10-01 open -1.818182
102 2018-11-01 open 0.000000
103 2018-12-01 open 3.636364
104 2019-01-01 open 3.636364
105 2019-02-01 open -5.454545
106 2019-03-01 open 5.454545
107 2019-04-01 open 5.454545
108 2019-05-01 open 3.636364
109 2019-06-01 open 0.000000
110 2019-07-01 open 0.000000
111 2019-08-01 open 1.818182
112 2019-09-01 open -7.272727
113 2019-10-01 open -1.818182
114 2019-11-01 open -1.818182
115 2019-12-01 open -7.272727
116 2020-01-01 open 0.000000
117 2020-02-01 open -5.454545
118 2020-03-01 open -12.727273
119 2020-04-01 open -20.000000
120 2020-05-01 open -18.181818
121 2020-06-01 open -12.727273
122 2020-07-01 open 0.000000
123 2020-08-01 open -5.454545
124 2020-09-01 open 0.000000
125 2020-10-01 open 10.909091
126 2020-11-01 open 5.454545
127 2020-12-01 open 1.818182
128 2021-01-01 open 5.454545
129 2021-02-01 open 27.272727
130 2021-03-01 open 10.909091
131 2021-04-01 open 18.181818
132 2021-05-01 open 23.636364
133 2021-06-01 open 27.272727
134 2021-07-01 open 49.090909
135 2016-01-01 hires 0.000000
136 2016-02-01 hires -4.000000
137 2016-03-01 hires -8.000000
138 2016-04-01 hires -12.000000
139 2016-05-01 hires -16.000000
140 2016-06-01 hires -16.000000
141 2016-07-01 hires -24.000000
142 2016-08-01 hires -12.000000
143 2016-09-01 hires -20.000000
144 2016-10-01 hires -8.000000
145 2016-11-01 hires -20.000000
146 2016-12-01 hires -16.000000
147 2017-01-01 hires 0.000000
148 2017-02-01 hires -28.000000
149 2017-03-01 hires -4.000000
150 2017-04-01 hires -16.000000
151 2017-05-01 hires -4.000000
152 2017-06-01 hires -12.000000
153 2017-07-01 hires -8.000000
154 2017-08-01 hires -16.000000
155 2017-09-01 hires -20.000000
156 2017-10-01 hires -4.000000
157 2017-11-01 hires -16.000000
158 2017-12-01 hires -16.000000
159 2018-01-01 hires -4.000000
160 2018-02-01 hires -12.000000
161 2018-03-01 hires -24.000000
162 2018-04-01 hires -20.000000
163 2018-05-01 hires -16.000000
164 2018-06-01 hires 0.000000
165 2018-07-01 hires -20.000000
166 2018-08-01 hires -16.000000
167 2018-09-01 hires -4.000000
168 2018-10-01 hires -24.000000
169 2018-11-01 hires -16.000000
170 2018-12-01 hires -12.000000
171 2019-01-01 hires -36.000000
172 2019-02-01 hires -16.000000
173 2019-03-01 hires -16.000000
174 2019-04-01 hires -8.000000
175 2019-05-01 hires -12.000000
176 2019-06-01 hires -16.000000
177 2019-07-01 hires 4.000000
178 2019-08-01 hires -4.000000
179 2019-09-01 hires -12.000000
180 2019-10-01 hires -16.000000
181 2019-11-01 hires -8.000000
182 2019-12-01 hires -16.000000
183 2020-01-01 hires -12.000000
184 2020-02-01 hires -4.000000
185 2020-03-01 hires -4.000000
186 2020-04-01 hires -24.000000
187 2020-05-01 hires -32.000000
188 2020-06-01 hires -20.000000
189 2020-07-01 hires -16.000000
190 2020-08-01 hires -8.000000
191 2020-09-01 hires 0.000000
192 2020-10-01 hires -8.000000
193 2020-11-01 hires -12.000000
194 2020-12-01 hires -20.000000
195 2021-01-01 hires -24.000000
196 2021-02-01 hires -20.000000
197 2021-03-01 hires -20.000000
198 2021-04-01 hires -16.000000
199 2021-05-01 hires -20.000000
200 2021-06-01 hires -16.000000
201 2021-07-01 hires -12.000000
I want R to recognize my "date" variable as a date variable so I can break down time periods for my graph. However, it seems like my "date" colum does not have any format, not even character one, when I run "class (date)" the output is "function". I think the format is unknown for R.
Can anyone help me to format my date variable?
Thanks,
Claudia