Dosen Pengampu : Prof. Dr. Suhartono, M.Kom

Lembaga : Universitas Islam Negeri Maulana Malik Ibrahim Malang

Jurusan : Teknik Informatika

library(readxl)
## Warning: package 'readxl' was built under R version 4.1.2
datainflow <- read_excel(path = "inflowTahun.xlsx")
datainflow
## # A tibble: 11 x 12
##    Tahun Sumatera   Aceh `Sumatera Utara` `Sumatera Barat`   Riau `Kep. Riau`
##    <dbl>    <dbl>  <dbl>            <dbl>            <dbl>  <dbl>       <dbl>
##  1  2011   57900.  2308.           23238.            9385.  3012.       1426.
##  2  2012   65911.  2620.           25981.           11192.  4447.       2236.
##  3  2013   98369. 36337.           18120.           14056.  8933.       3378.
##  4  2014   86024.  4567.           30503.           14103.  6358.       2563.
##  5  2015   86549.  4710.           30254.           13309.  7156.       3218.
##  6  2016   97764.  5775.           34427.           14078.  8211.       4317.
##  7  2017  103748.  5514.           35617.           15312.  8553.       4412.
##  8  2018  117495.  5799.           41769.           15058. 10730.       5134.
##  9  2019  133762.  7509.           47112.           14750. 10915.       6077.
## 10  2020  109345.  6641.           36609.           10696.  9148.       6175.
## 11  2021   89270.  3702.           31840.           10748.  7769.       5009.
## # ... with 5 more variables: Jambi <dbl>, Sumatera Selatan <dbl>,
## #   Bengkulu <dbl>, Lampung <dbl>, Kep. Bangka Belitung <dbl>
library(readxl)
dataoutflow <- read_excel(path = "OutflowTahun.xlsx")
dataoutflow
## # A tibble: 11 x 12
##    Tahun Sumatera   Aceh `Sumatera Utara` `Sumatera Barat`   Riau `Kep. Riau`
##    <dbl>    <dbl>  <dbl>            <dbl>            <dbl>  <dbl>       <dbl>
##  1  2011   80092.  6338.           22176.            5300. 12434.       5819.
##  2  2012   85235.  6378.           22495.            6434. 13014.       6966.
##  3  2013  103288. 23278.           19235.            6511. 15460.       8747.
##  4  2014  102338.  8630.           26391.            7060. 15158.      10122.
##  5  2015  109186.  9637.           27877.            7471. 15789.       9803.
##  6  2016  121992. 11311.           31959.            9198. 17645.      10068.
##  7  2017  133606. 11760.           35243.           10754. 18128.      10749.
##  8  2018  135676. 11450.           36908.            8447. 17926.      12597.
##  9  2019  153484. 13087.           44051.            9465. 19277.      12644.
## 10  2020  140589. 12874.           39758.            8763. 19139.       8461.
## 11  2021   86627.  5770.           23453.            5941. 12631.       5128.
## # ... with 5 more variables: Jambi <dbl>, Sumatera Selatan <dbl>,
## #   Bengkulu <dbl>, Lampung <dbl>, Kep. Bangka Belitung <dbl>
datainflow$Jambi
##  [1] 1867.621 2138.463 3046.784 5169.097 4978.134 4398.161 4403.638 5656.590
##  [9] 6486.166 5628.402 4979.747
plot(datainflow$Jambi, type = "l", col = "red")

dataoutflow$Bengkulu
##  [1] 2560.502 2959.332 6489.611 4582.922 4851.534 5162.737 5446.743 5495.251
##  [9] 6841.649 6564.020 4680.854
plot(dataoutflow$Jambi, type = "l", col = "blue")

plot(datainflow$Jambi, type = "l", col = "red")
lines(dataoutflow$Jambi, type = "l", col = "blue")

library(readxl)
datainflowBulan <- read_excel(path = "inflowBulan.xlsx")
datainflowBulan
## # A tibble: 128 x 12
##    keterangan          Sumatera  Aceh `Sumatera Utara` `Sumatera Barat`   Riau
##    <dttm>                 <dbl> <dbl>            <dbl>            <dbl>  <dbl>
##  1 2011-01-01 00:00:00    4164.  124.            2068.             545.   94.2
##  2 2011-02-01 00:00:00    3338.  115.            1826.             450.   96.4
##  3 2011-03-01 00:00:00    4878.  154.            2028.             849.  288. 
##  4 2011-04-01 00:00:00    3157.  122.            1429.             539.  160. 
##  5 2011-05-01 00:00:00    3821.  123.            1539.             692.  195. 
##  6 2011-06-01 00:00:00    3686.  151.            1637.             592.  101. 
##  7 2011-07-01 00:00:00    4370.  107.            1791.             800.  143. 
##  8 2011-08-01 00:00:00    3668.  184.            1256.             586.  134. 
##  9 2011-09-01 00:00:00   12875.  606.            4172.            2176. 1014. 
## 10 2011-10-01 00:00:00    4777.  158.            1941.             787.  341. 
## # ... with 118 more rows, and 6 more variables: Kep. Riau <dbl>, Jambi <dbl>,
## #   Sumatera Selatan <dbl>, Bengkulu <dbl>, Lampung <dbl>,
## #   Kep. Bangka Belitung <dbl>
library(readxl)
dataoutflowBulan <- read_excel(path = "OutflowBulan.xlsx")
dataoutflowBulan
## # A tibble: 128 x 12
##    Bulan               Sumatera  Aceh `Sumatera Utara` `Sumatera Barat`  Riau
##    <dttm>                 <dbl> <dbl>            <dbl>            <dbl> <dbl>
##  1 2011-01-01 00:00:00    3442.  350.             941.             307.  478.
##  2 2011-02-01 00:00:00    3989.  193.             990.             228.  400.
##  3 2011-03-01 00:00:00    4229.  230.            1209.             347.  621.
##  4 2011-04-01 00:00:00    6721.  529.            1653.             336. 1006.
##  5 2011-05-01 00:00:00    5787.  523.            1465.             328. 1000.
##  6 2011-06-01 00:00:00    7395.  406.            2167.             399. 1366.
##  7 2011-07-01 00:00:00    7154.  958.            1695.             449.  815.
##  8 2011-08-01 00:00:00   16043. 1046.            4104.            1376. 2729.
##  9 2011-09-01 00:00:00    1915.  124.             824.             148.  154.
## 10 2011-10-01 00:00:00    5174.  634.            1392.             299.  830.
## # ... with 118 more rows, and 6 more variables: Kep. Riau <dbl>, Jambi <dbl>,
## #   Sumatera Selatan <dbl>, Bengkulu <dbl>, Lampung <dbl>,
## #   Kep. Bangka Belitung <dbl>
datainflowBulan$Jambi
##   [1]   48.21238   39.91336  202.77581   76.36759  102.29337   80.38363
##   [7]  118.45074   91.88117  618.33464  137.23519  238.83742  112.93547
##  [13]  214.78357  185.06614  118.25569  112.18712  176.73267  131.65442
##  [19]  178.67562  446.70847  180.60249   96.89252  190.29249  106.61224
##  [25]  440.25724  250.16557  156.40296  131.70444   80.43460   90.88444
##  [31]  150.73569  696.17818  239.01380  381.11280  240.84581  189.04884
##  [37]  648.84622  443.17728  218.60749  372.98546  277.49781  326.07002
##  [43]  228.38825 1336.65537  383.31015  366.82210  328.60113  238.13597
##  [49]  800.91577  310.67803  334.27000  339.99797  285.21811  266.80514
##  [55] 1033.05014  473.13670  295.54859  329.75416  266.79923  241.96031
##  [61]  723.86727  399.44327  227.89071  207.32596  294.89205  265.25147
##  [67] 1069.41796  211.81993  325.26906  251.99989  234.81316  186.17002
##  [73]  436.71704  349.18620  374.44420  291.87853  265.93193  109.35945
##  [79] 1008.96424  331.35488  369.25742  288.45059  300.80490  277.28824
##  [85]  850.92308  423.79251  432.57396  284.21732  331.44473  943.33760
##  [91]  555.66909  452.09732  390.12811  409.82051  356.98477  225.60052
##  [97]  928.32921  508.44605  501.71263  395.87576  375.81227 1377.08370
## [103]  517.64046  582.60662  370.00861  477.26284  302.21112  149.17703
## [109]  929.25223  453.21208  375.57835  488.00832  366.02264  926.36280
## [115]  418.88012  362.62433  363.94528  290.43227  404.08403  249.99980
## [121] 1319.31010  533.89020  481.47669  442.30053  954.47189  568.16022
## [127]  337.72947  342.40788
datainflowBulan <- datainflowBulan$`Jambi`
plot.ts(datainflowBulan , type = "l", col = "red")

dataoutflowBulan$Jambi
##   [1]  297.46348  280.08970  341.37188  474.26014  371.36905  540.43609
##   [7]  428.10203 1056.05643   92.78528  295.39728  272.21261  767.15036
##  [13]  133.61579  321.29557  315.41057  373.26078  441.58952  474.63459
##  [19]  330.20592  835.74847  221.85612  472.49384  299.07579  794.04754
##  [25]  110.31731  184.50535  223.54744  235.42017  450.54670  349.51626
##  [31]  839.48154  339.88048  732.69193  819.24007  782.02490 1235.18658
##  [37]  351.35683  459.63127  637.62828  526.41165  683.34064  651.89272
##  [43] 1929.38736  274.46904  553.86575  703.65271  588.68032 1000.86095
##  [49]  249.99472  486.10988  549.06994  721.86428  701.16932  931.14718
##  [55] 1582.71912  395.76377  549.45261  479.75684  631.21748 1046.24662
##  [61]  229.69662  442.46621  487.32817  572.51965  587.13872 1610.89703
##  [67]  456.38157  430.25770  842.64910  521.69293  648.58138  944.35648
##  [73]  394.17886  553.63581  500.03923  530.31764  570.86673 1961.91565
##  [79]  212.49734  680.41258  470.55865  568.53590  820.95090 1169.98413
##  [85]  275.03184  451.87980  498.71186  687.34280 1222.83919 1579.32715
##  [91]  391.43773  555.29629  475.32140  545.11918  735.03562 1042.05433
##  [97]  218.20233  534.52562  559.51510  895.65817 2018.12386  147.10847
## [103]  717.81375  656.73797  617.28665  719.15618  727.75492 1392.15834
## [109]  230.43948  421.99569  606.04929  713.68012 1262.75583  143.79548
## [115]  633.64958  610.36918  689.06184 1124.09728  807.10093 1706.97368
## [121]   54.41456  487.87292  732.48101 1261.14201 1578.66374  642.31328
## [127]  664.55917  624.91746
dataoutflowBulan <- dataoutflowBulan$`Jambi`
plot.ts(dataoutflowBulan , type = "l", col = "blue")

plot(datainflow$`Jambi`, type = "l", col = "red")
lines(dataoutflow$`Jambi`, col="green")
legend("top",c("Inflow","Outflow"),fill=c("red","green"))

Daftar Pustaka

https://rpubs.com/suhartono-uinmaliki/861286