-
Notifications
You must be signed in to change notification settings - Fork 0
/
08-useandpump.Rmd
619 lines (544 loc) · 24.3 KB
/
08-useandpump.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
# EGAT internal electricity use and pump and storage
EGAT internal electricity use is categorized into 5 groups as follows:
* EGAT head office and others
* EGAT substations and their offices
* EGAT station services (other processes in force outage power plants)
* Mae Moh mining
* EGAT pump and storage system
The EGAT electricity consumption data is obtained from Power System Control and Operation Division (ฝ่ายควบคุมระบบกำลังไฟฟ้า (อคฟ.)),
Power Generation and Purchase Data Processing Department (กองประมวลผลข้อมูลการผลิตและซื้อขายไฟฟ้า (กผฟ-ส.)) [website](http://control.egat.co.th/gpddwebsite/index.aspx) (EGAT intranet only).
## Electricity consumption in EGAT head office and others {#elyegatheadoffice}
Electricity consumption is taken from Head of National Load forecast section. The file name is `01 EGAT_20Oct2022_งบ66 67_Final.xlsx`. The R code chunk is given below.
```{r use_office, echo=TRUE, warning=FALSE, message=FALSE}
use_office <-
read_excel("raw_data/01 EGAT_20Oct2022_งบ66 67_Final.xlsx",
sheet = "C_LossUse",
range = "C18:D45",
col_names = c("year_th", "ely_gwh")) %>%
mutate(year = year_th - 543)
```
```{r anno_useoffice, echo=FALSE, message=FALSE, warning=FALSE}
annouseoffice2010 <-
use_office %>%
filter(year == 2010) %>%
select(-year_th)
annouseoffice2019 <-
use_office %>%
filter(year == 2019)
annouseoffice2023 <-
use_office %>%
filter(year == 2023)
```
An electricity use in EGAT head office and others reached its peak 37 GWh in 2019. In 2023, it assumed that the electricity consumption will be similar to those in 2018 at 35 GWh due to EGAT staff returned to work onsite (see Figure \@ref(fig:plot-useandoffice)).
```{r plot-useandoffice, echo=FALSE, warning=FALSE, message=FALSE, fig.cap='Electricity consumption in EGAT head office and others', fig.align='center', out.width= '90%'}
use_office %>%
ggplot(aes(x = year, y = ely_gwh)) +
geom_line(aes(color = "salmon"),
show.legend = FALSE)+
geom_vline(xintercept = 2010)+
geom_vline(xintercept = 2022)+
geom_point(shape = 21,
size = 2,
color = "salmon",
fill = "grey")+
geom_text(label = "Historical data",
aes(x = 2016, y = 50),
color = "dodgerblue",
show.legend = FALSE,
inherit.aes = FALSE)+
geom_text(label = "Projected data",
aes(x = 2030, y = 50),
color = "dodgerblue",
show.legend = FALSE,
inherit.aes = FALSE)+
scale_x_continuous(breaks = c(2010,2015, 2020,2025, 2030,2037))+
scale_y_continuous(breaks = seq(0,50,10),
limits = c(0,50))+
ThemeLine+
labs(x = NULL,
y = "Electricity consumption (GWh)")+
geom_text_repel(data = annouseoffice2010,
aes(x = year, y = ely_gwh,
label = paste0(formatC(annouseoffice2010$ely_gwh, format = "d"), " GWh")),
hjust = 0.9,
size = 4,
nudge_x = 2,
nudge_y = 4,
inherit.aes = FALSE)+
geom_text_repel(data = annouseoffice2019,
aes(x = year, y = ely_gwh,
label = paste0(formatC(annouseoffice2019$ely_gwh, format = "d"), " GWh")),
hjust = 0.9,
size = 4,
nudge_y = 4,
inherit.aes = FALSE)+
geom_text_repel(data = annouseoffice2023,
aes(x = year, y = ely_gwh,
label = paste0(formatC(annouseoffice2023$ely_gwh, format = "d"), " GWh")),
hjust = 0.9,
size = 4,
nudge_x = 2,
nudge_y = 4,
inherit.aes = FALSE)
```
## Electricity consumption in EGAT substations and their offices {#elyegatsub}
The data is extracted from `01 EGAT_20Oct2022_งบ66 67_Final.xlsx`. The R code chuck is given below.
```{r use_egatsub, echo=TRUE, warning=FALSE, message=FALSE}
use_egatsub <-
read_excel("raw_data/01 EGAT_20Oct2022_งบ66 67_Final.xlsx",
sheet = "C_LossUse",
range = "C59:D86",
col_names = c("year_th", "ely_gwh")) %>%
mutate(year = year_th - 543)
```
```{r anno_egatsub, echo=FALSE, warning=FALSE, message=FALSE}
annouseegatsub2010 <-
use_egatsub %>%
filter(year ==2010)
annouseegatsub2015 <-
use_egatsub %>%
filter(year ==2015)
annouseegatsub2023 <-
use_egatsub %>%
filter(year ==2023)
```
An electricity consumption in EGAT substations decreased from 84 GWh in 2010 to 64 GWh in 2015. It is assumed that the electricity consumption will be similar to those in 2019 (see Figure \@ref(fig:plot-useegatsub)).
```{r plot-useegatsub, echo=FALSE, warning=FALSE, message=FALSE, fig.cap='Electricity consumption in EGAT substations', fig.align='center', out.width= '90%'}
use_egatsub %>%
ggplot(aes(x = year, y = ely_gwh)) +
geom_line(aes(color = "salmon"),
show.legend = FALSE)+
geom_vline(xintercept = 2010)+
geom_vline(xintercept = 2022)+
geom_point(shape = 21,
size = 2,
color = "salmon",
fill = "grey")+
geom_text(label = "Historical data",
aes(x = 2016, y = 150),
color = "dodgerblue",
show.legend = FALSE,
inherit.aes = FALSE)+
geom_text(label = "Projected data",
aes(x = 2030, y = 150),
color = "dodgerblue",
show.legend = FALSE,
inherit.aes = FALSE)+
scale_x_continuous(breaks = c(2010,2015, 2020, 2025, 2030,2037))+
scale_y_continuous(breaks = seq(0,150,50),
limits = c(0,150))+
ThemeLine+
labs(x = NULL,
y = "Electricity consumption (GWh)")+
geom_text_repel(data = annouseegatsub2010,
aes(x = year, y = ely_gwh,
label = paste0(formatC(annouseegatsub2010$ely_gwh, format = "d"), " GWh")),
hjust = 0.9,
size = 4,
nudge_x = 3,
nudge_y = 10,
inherit.aes = FALSE)+
geom_text_repel(data = annouseegatsub2015,
aes(x = year, y = ely_gwh,
label = paste0(formatC(annouseegatsub2015$ely_gwh, format = "d"), " GWh")),
hjust = 0.9,
size = 4,
nudge_x = 3,
nudge_y = -10,
inherit.aes = FALSE)+
geom_text_repel(data = annouseegatsub2023,
aes(x = year, y = ely_gwh,
label = paste0(formatC(annouseegatsub2023$ely_gwh, format = "d"), " GWh")),
hjust = 0.9,
size = 4,
nudge_x = 3,
nudge_y = 10,
inherit.aes = FALSE)
```
## Electricity consumption in station service (off-load) {#elystationservice}
The data is extracted from `01 EGAT_20Oct2022_งบ66 67_Final.xlsx`. The R code chuck is given below.
```{r use_statserv, echo=TRUE, warning=FALSE, message=FALSE}
use_statserv <-
read_excel("raw_data/01 EGAT_20Oct2022_งบ66 67_Final.xlsx",
sheet = "C_LossUse",
range = "C100:D127",
col_names = c("year_th", "ely_gwh")) %>%
mutate(year = year_th - 543)
```
```{r anno_use_statserv, echo=FALSE, message=FALSE, warning=FALSE}
annousestatserv2022 <-
use_statserv %>%
filter(year == 2022)
annousestatserv2023 <-
use_statserv %>%
filter(year == 2023)
```
An electricity consumption in station services (off-load) reached its peak 103 GWh in 2022. It is assumed that the consumption in 2023 would be similar to those in 2019 (see Figure \@ref(fig:plot-usestatserv)).
```{r plot-usestatserv, echo=FALSE, message=FALSE, warning=FALSE, fig.cap='Electricity consumption in station service (off-load)', fig.align='center', out.width= '90%'}
use_statserv %>%
ggplot(aes(x = year, y = ely_gwh)) +
geom_line(aes(color = "salmon"),
show.legend = FALSE)+
geom_vline(xintercept = 2010)+
geom_vline(xintercept = 2022)+
geom_point(shape = 21,
size = 2,
color = "salmon",
fill = "grey")+
geom_text(label = "Data unavailable",
aes(x = 2011, y = 1),
size = 3,
color = "darkgrey",
nudge_x = 1,
nudge_y = 10,
show.legend = FALSE,
inherit.aes = FALSE)+
geom_text(label = "Historical data",
aes(x = 2016, y = 150),
color = "dodgerblue",
show.legend = FALSE,
inherit.aes = FALSE)+
geom_text(label = "Projected data",
aes(x = 2030, y = 150),
color = "dodgerblue",
show.legend = FALSE,
inherit.aes = FALSE)+
scale_x_continuous(breaks = c(2010,2015, 2020, 2025, 2030,2037))+
scale_y_continuous(breaks = seq(0,150,50),
limits = c(0,150))+
ThemeLine+
labs(x = NULL,
y = "Electricity consumption (GWh)")+
geom_text_repel(data = annousestatserv2022,
aes(x = year, y = ely_gwh,
label = paste0(formatC(annousestatserv2022$ely_gwh, format = "d"), " GWh")),
hjust = 0.9,
size = 4,
nudge_x = 3.5,
nudge_y = 10,
inherit.aes = FALSE)+
geom_text_repel(data = annousestatserv2023,
aes(x = year, y = ely_gwh,
label = paste0(formatC(annousestatserv2023$ely_gwh, format = "d"), " GWh")),
hjust = 0.9,
size = 4,
nudge_x = 2,
nudge_y = 10,
inherit.aes = FALSE)
```
## Electricity consumption in Mae Moh mining {#elymaemoh}
The data is extracted from `01 EGAT_20Oct2022_งบ66 67_Final.xlsx`. The R code chuck is given below.
```{r use_maemoh, echo=TRUE, warning=FALSE, message=FALSE}
use_maemoh <-
read_excel("raw_data/01 EGAT_20Oct2022_งบ66 67_Final.xlsx",
sheet = "C_LossUse",
range = "C149:D176",
col_names = c("year_th", "ely_gwh")) %>%
mutate(year = year_th - 543)
```
```{r anno_use_maemoh, echo=FALSE, warning=FALSE, message=FALSE}
annousemaemoh2010 <-
use_maemoh %>%
filter(year == 2010)
annousemaemoh2017 <-
use_maemoh %>%
filter(year == 2017)
annousemaemoh2023 <-
use_maemoh %>%
filter(year == 2023)
annousemaemoh2026 <-
use_maemoh %>%
filter(year == 2026)
annousemaemoh2029 <-
use_maemoh %>%
filter(year == 2029)
annousemaemoh2035 <-
use_maemoh %>%
filter(year == 2035)
```
An electricity consumption in Mea Moh mining would reach its peak 912 GWh in 2023 and would gradually decrease (see Figure \@ref(fig:plot-usemaemoh)). A mining electricity consumption depends on a mining schedule. It is unpredictable. It should be closely monitored. The contact number is Tel. **66440** (internal call), Mechanical and Electrical Engineering Department (กวคฟ-ช.), Fuel Engineering Division (อวพ.), Deputy Governor-Fuel (รวช.).
```{r plot-usemaemoh, echo=FALSE,warning=FALSE, message=FALSE, fig.cap='Electricity consumption in Mae Moh mining', fig.align='center', out.width= '90%'}
use_maemoh %>%
ggplot(aes(x = year, y = ely_gwh)) +
geom_line(aes(color = "salmon"),
show.legend = FALSE)+
geom_vline(xintercept = 2010)+
geom_vline(xintercept = 2022)+
geom_point(shape = 21,
size = 2,
color = "salmon",
fill = "grey")+
geom_text(label = "Historical data",
aes(x = 2016, y = 1200),
color = "dodgerblue",
show.legend = FALSE,
inherit.aes = FALSE)+
geom_text(label = "Projected data",
aes(x = 2030, y = 1200),
color = "dodgerblue",
show.legend = FALSE,
inherit.aes = FALSE)+
scale_x_continuous(breaks = c(2010,2015, 2020, 2025, 2030,2037))+
scale_y_continuous(breaks = seq(0,1200,100),
limits = c(0,1200),
labels = comma)+
ThemeLine+
labs(x = NULL,
y = "Electricity consumption (GWh)")+
geom_text_repel(data = annousemaemoh2010,
aes(x = year, y = ely_gwh,
label = paste0(formatC(annousemaemoh2010$ely_gwh, format = "d"), " GWh")),
hjust = 0.9,
size = 4,
nudge_x = 3.5,
nudge_y = -100,
inherit.aes = FALSE)+
geom_text_repel(data = annousemaemoh2017,
aes(x = year, y = ely_gwh,
label = paste0(formatC(annousemaemoh2017$ely_gwh, format = "d"), " GWh")),
size = 4,
nudge_y = -100,
inherit.aes = FALSE)+
geom_text_repel(data = annousemaemoh2023,
aes(x = year, y = ely_gwh,
label = paste0(formatC(annousemaemoh2023$ely_gwh, format = "d"), " GWh")),
hjust = 0.9,
size = 4,
nudge_x = 3.5,
nudge_y = 100,
inherit.aes = FALSE)+
geom_text_repel(data = annousemaemoh2026,
aes(x = year, y = ely_gwh,
label = paste0(formatC(annousemaemoh2026$ely_gwh, format = "d"), " GWh")),
size = 4,
nudge_y = -100,
inherit.aes = FALSE)+
geom_text_repel(data = annousemaemoh2029,
aes(x = year, y = ely_gwh,
label = paste0(formatC(annousemaemoh2029$ely_gwh, format = "d"), " GWh")),
hjust = 0.9,
size = 4,
nudge_x = 3.5,
nudge_y = 100,
inherit.aes = FALSE)+
geom_text_repel(data = annousemaemoh2035,
aes(x = year, y = ely_gwh,
label = paste0(formatC(annousemaemoh2035$ely_gwh, format = "d"), " GWh")),
# hjust = 0.9,
size = 4,
# nudge_x = 3.5,
nudge_y = -100,
inherit.aes = FALSE)
```
## Electricity consumption in pumped storage hydropower plants {#elypump}
The data is extracted from `01 EGAT_20Oct2022_งบ66 67_Final.xlsx`. The R code chuck is given below.
```{r use_pump, echo=TRUE, warning=FALSE, message=FALSE}
use_pump <-
read_excel("raw_data/01 EGAT_20Oct2022_งบ66 67_Final.xlsx",
sheet = "C_LossUse",
range = "C190:D217",
col_names = c("year_th", "ely_gwh")) %>%
mutate(year = year_th - 543)
```
```{r anno_use_pump, echo=FALSE, message=FALSE, warning=FALSE}
annousepump2010 <-
use_pump %>%
filter(year == 2010)
annousepump2020 <-
use_pump %>%
filter(year == 2020)
annousepump2023 <-
use_pump %>%
filter(year == 2023)
```
As of August 2023, there are 3 EGAT's pumped storage hydropower plants as follows:
* **Srinagarind** pumped storage hydropower plant **unit 4 and 5**, Kanchanaburi with **360 MW** of installed capacity;
* **Bhumibol** pumped storage hydropower plant **unit 8**, Tak with **171 MW** of installed capacity; and
* **Lamtakong** pumped storage hydropower plant, Nakorn Ratchasima with **1,000 MW** of installed capacity
The *Chulabhorn* pumped storage hydropower plant is currently under an Environmental Impact Assessment (EIA). The plant's commercial operation date (COD) would be in *2034* with *800 MW* of installed capacity.\
An electricity consumption by pumped storage hydropower plants increased from 434 GWh in 2010 and reached it peak 610 GWh in 2020. Power System Control and Operation Division (ฝ่ายควบคุมระบบกำลังไฟฟ้า (อคฟ.)) estimates a yearly operation short- and a long-term plans. It is estimated that the electricity consumption would be 555 GWh in 2023 until 2037 (see Figure \@ref(fig:plot-usepump)). It accounts only the electricity consumption in the Lamtakong pumped storage hydropower plant.
```{r plot-usepump, echo=FALSE, message=FALSE, warning=FALSE, fig.cap='Electricity consumption by pumped storage hydropower plants', fig.align='center', out.width= '90%'}
use_pump %>%
ggplot(aes(x = year, y = ely_gwh)) +
geom_line(aes(color = "salmon"),
show.legend = FALSE)+
geom_vline(xintercept = 2010)+
geom_vline(xintercept = 2022)+
geom_point(shape = 21,
size = 2,
color = "salmon",
fill = "grey")+
geom_text(label = "Historical data",
aes(x = 2016, y = 800),
color = "dodgerblue",
show.legend = FALSE,
inherit.aes = FALSE)+
geom_text(label = "Projected data",
aes(x = 2030, y = 800),
color = "dodgerblue",
show.legend = FALSE,
inherit.aes = FALSE)+
scale_x_continuous(breaks = c(2010,2015, 2020, 2025, 2030,2037))+
scale_y_continuous(breaks = seq(0,800,100),
limits = c(0,800),
labels = comma)+
ThemeLine+
labs(x = NULL,
y = "Electricity consumption (GWh)")+
geom_text_repel(data = annousepump2010,
aes(x = year, y = ely_gwh,
label = paste0(formatC(annousepump2010$ely_gwh, format = "d"), " GWh")),
hjust = 0.9,
size = 4,
nudge_x = 3.5,
nudge_y = 50,
inherit.aes = FALSE)+
geom_text_repel(data = annousepump2020,
aes(x = year, y = ely_gwh,
label = paste0(formatC(annousepump2020$ely_gwh, format = "d"), " GWh")),
size = 4,
nudge_y = 50,
inherit.aes = FALSE)+
geom_text_repel(data = annousepump2023,
aes(x = year, y = ely_gwh,
label = paste0(formatC(annousepump2023$ely_gwh, format = "d"), " GWh")),
size = 4,
nudge_x = 1,
nudge_y = 50,
inherit.aes = FALSE)
```
## Total EGAT internal electricity consumption
Total EGAT internal electricity consumption can be found in equation \@ref(eq:totalUsePump).
\begin{align*}
TOTUSEPUMP_{t} = & ELY_{headoffice,t}+ELY_{substation,t}+ELY_{stationserv,t}+\\
& ELY_{maemoh,t}+ELY_{pump,t}
(\#eq:totalUsePump)
\end{align*}
Where,\
$TOTUSEPUMP_{t}$ denotes total EGAT internal electricity consumption in year $t$.\
$ELY_{headoffice}$ denotes an electricity consumption in EGAT head office and others in year $t$ (see section \@ref(elyegatheadoffice)).\
$ELY_{substation}$ denotes an electricity consumption in EGAT substations in year $t$ (see section \@ref(elyegatsub)).\
$ELY_{stationserv,t}$ denotes an electricity consumption in EGAT station services in year $t$ (see section \@ref(elystationservice)).\
$ELY_{maemoh,t}$ denotes an electricity consumption in EGAT Mae Moh mining in year $t$ (see section \@ref(elymaemoh)).\
$ELY_{pump,t}$ denotes an electricity consumption in EGAT pumped storage hydropower plants in year $t$ (see section \@ref(elypump)).\
```{r total_usepump, echo=TRUE, warning=FALSE, message=FALSE}
total_usepump <-
use_office %>%
select(year, use_office = ely_gwh) %>%
mutate(use_egatsub = use_egatsub$ely_gwh,
use_statserv = use_statserv$ely_gwh,
use_maemoh = use_maemoh$ely_gwh,
use_pump = use_pump$ely_gwh,
total_usepump = use_office + use_egatsub + use_statserv + use_maemoh + use_pump)
```
```{r anno_totalusepump, echo=FALSE, message=FALSE, warning=FALSE}
annototalusepump2010 <-
total_usepump %>%
select(year, total_usepump) %>%
filter(year == 2010)
annototalusepump2021 <-
total_usepump %>%
select(year, total_usepump) %>%
filter(year == 2021)
annototalusepump2023 <-
total_usepump %>%
select(year, total_usepump) %>%
filter(year == 2023)
annototalusepump2035 <-
total_usepump %>%
select(year, total_usepump) %>%
filter(year == 2035)
```
Total EGAT internal electricity consumption increased from 902 GWh in 2010 and will reaches it peak 1,674 GWh in 2023. In 2037, the consumption will decline to 1,259 GWh (see Figure \@ref(fig:plot-totalusepump)). Figure \@ref(fig:plot-facettotalusepump) illustates electricity consumption by category. **Mae Moe mining** plays an key role in using the EGAT internal electricity consumption, followed by **pumped storage hydropower plants**.
```{r plot-totalusepump, echo=FALSE, message=FALSE, warning=FALSE, fig.cap='Total EGAT internal electricity consumption', fig.align='center', out.width= '90%'}
total_usepump %>%
ggplot(aes(x = year, y = total_usepump)) +
geom_line(aes(color = "salmon"),
show.legend = FALSE)+
geom_vline(xintercept = 2010)+
geom_vline(xintercept = 2022)+
geom_point(shape = 21,
size = 2,
color = "salmon",
fill = "grey")+
geom_text(label = "Historical data",
aes(x = 2016, y = 2000),
color = "dodgerblue",
show.legend = FALSE,
inherit.aes = FALSE)+
geom_text(label = "Projected data",
aes(x = 2030, y = 2000),
color = "dodgerblue",
show.legend = FALSE,
inherit.aes = FALSE)+
scale_x_continuous(breaks = c(2010,2015, 2020, 2025, 2030,2037))+
scale_y_continuous(breaks = seq(0,2000,200),
limits = c(0,2000),
labels = comma)+
ThemeLine+
labs(x = NULL,
y = "Electricity consumption (GWh)")+
geom_text_repel(data = annototalusepump2010,
aes(x = year, y = total_usepump,
label = paste0(formatC(annototalusepump2010$total_usepump, format = "d"), " GWh")),
hjust = 0.5,
size = 4,
nudge_x = 1.8,
nudge_y = 100,
inherit.aes = FALSE)+
geom_text_repel(data = annototalusepump2021,
aes(x = year, y = total_usepump,
label = paste0(formatC(annototalusepump2021$total_usepump, format = "d", big.mark = ","), " GWh")),
hjust = 0.5,
size = 4,
nudge_x = -1.8,
nudge_y = 200,
inherit.aes = FALSE)+
geom_text_repel(data = annototalusepump2023,
aes(x = year, y = total_usepump,
label = paste0(formatC(annototalusepump2023$total_usepump, format = "d", big.mark = ","), " GWh")),
hjust = 0.5,
size = 4,
nudge_x = 1.8,
nudge_y = 200,
inherit.aes = FALSE)+
geom_text_repel(data = annototalusepump2035,
aes(x = year, y = total_usepump,
label = paste0(formatC(annototalusepump2035$total_usepump, format = "d", big.mark = ","), " GWh")),
hjust = 0.5,
size = 4,
nudge_x = 1.8,
nudge_y = 200,
inherit.aes = FALSE)
```
```{r plot-facettotalusepump, echo=FALSE, message = FALSE, warning = FALSE, fig.cap = 'Total EGAT electricity consumption by categories', fig.align='center', out.width= '90%'}
use_office %>%
select(year, use_office = ely_gwh) %>%
mutate(use_egatsub = use_egatsub$ely_gwh,
use_statserv = use_statserv$ely_gwh,
use_maemoh = use_maemoh$ely_gwh,
use_pump = use_pump$ely_gwh,
total_usepump = use_office + use_egatsub + use_statserv + use_maemoh + use_pump) %>%
pivot_longer(-year, names_to = "use", values_to = 'ely_gwh') %>%
mutate(use = factor(use,c("use_office", "use_egatsub","use_statserv","use_maemoh","use_pump","total_usepump"))) %>%
ggplot(aes(x = year, y = ely_gwh))+
geom_line(aes(group = use, color = use), show.legend = FALSE)+
geom_point(shape = 21,
size = 1,
color = "black",
fill = "grey")+
facet_wrap(~use,
scales = "free_y",
labeller = as_labeller(c(use_office = "EGAT head office",
use_egatsub = "EGAT substations",
use_statserv = "Station services",
use_maemoh = "Mae Moh mining",
use_pump = "Pumped storage",
total_usepump = "TOTAL consumption")))+
scale_x_continuous(breaks = c(2010, 2015,2020,2025,2030,2037))+
scale_y_continuous(labels = comma)+
ThemeLine+
scale_color_manual(values = linepalette1)+
labs(x = NULL,
y = "Electricity consumption (GWh)")
```