Q:

rolling window calculation in r using loop

I am looking for a way to calculate the formulas in the code below based on the last four observations. The results should then be saved in the last used observations. Meaning if the beta is calculated using the first four observations then the beta value should be saved in the fourth row. This should be repeated in a loop for the entire dataset. I have no idea how to implement this into my current code (attached below) and I am therefore looking for help in calculating this rolling window value. Another property I would like is for the beta to be missing whenever an observation is missing but this should be, to my understanding, be happening automatically.
Thanks in advance
My current code looks like this:
risk <- matrix(data = NA, 14660, ncol = 3)
for (i in 1:14657) {
  j <- i+3
 risk[j,1] <- cov(CombData[i:j,c(72)],CombData[i:j,c(79)])/var(CombData[i:j,c(79)])
 reg_risk <- lm(CombData[i:j,c(72)] ~ CombData[i:j,c(79)])
 risk[j,2] <- sigma(reg_risk) 
 risk[j,3] <- sd(CombData[i:j,c(72)])
}

My data looks like this:
structure(list(ExReturn = c(NA, 0.0138248847926268, 0.165809090909091, 
-0.00204931773879148, -0.091896875, 0.0343086021505376, 0.0331640332640333, 
-0.118812273641851, 0.0158817351598173, 0.0920348314606742, 0.160393827160494, 
0.0637297872340425, 0.0315666666666667, 0.0935995153473343, 0.0102397341211227, 
0.0043859649122806, -0.00291120815138279, -0.0262773722627737, 
0.0494752623688155, -0.135814285714286, 0.00165289256198342, 
-0.0264026402640264, -0.0405405405405406, 0.0746478873239436, 
0.0484927916120577, 0.01875, 0.0662576687116565, -0.0334716915995397, 
-0.025, 0.16971916971917, 0.0364344467640918, -0.0192339375629406, 
0.00606016427104715, 0.00500204081632648, -0.0132979695431472, 
0.0288065843621399, 0, -0.017, 0.00203458799593093, -0.016243654822335, 
0.0309597523219813, -0.0230230230230231, 0.00307377049180335, 
0.0469867211440245, 0.0253658536585366, 0.0466222645099905, 0.0181818181818181, 
-0.0178571428571429, -0.0227272727272727, 0.0186046511627906, 
-0.0182648401826484, 0.0437209302325581, 0.0204991087344029, 
0.0122270742358079, -0.0163934426229508, 0, -0.0719298245614035, 
-0.0737240075614367, -0.0214285714285715, 0.032325338894682, 
0.0434343434343434, 0.0658276863504357, 0.064486830154405, 0.0238907849829351, 
-0.0808333333333333, 0.029918404351768, -0.0536971830985915, 
-0.0148837209302326, -0.00188857412653443, 0.0236518448438978, 
-0.0259780036968577, -0.0589235294117647, -0.00826451612903225, 
0.00081626016260159, -0.0173588832487309, 0.146594214876033, 
0.0493495495495495, 0.0882120171673819, -0.0238593059936908, 
-0.0090852988691438, 0.0226198859005706, -0.00966175298804784, 
-0.00190901045856798, 0.00282320709105561, 0.00200963855421694, 
0.00851410256410264, 0.0352426528991263, 0.040044171779141, 0.00161075902726597, 
-0.0264352941176471, -0.00920188679245281, 0.00366621004566204, 
0.0028878787878789, -0.0158943396226415, -0.00549770114942526, 
-0.00417929176289457, 0.00276100386100385, 0.0295692307692307, 
0.0321820895522387, 0.0238707581227436, 0.0373323943661972, -0.0185491525423728, 
0.00529655172413794, -0.0151986301369864, 0.0258777777777777, 
-0.116664864864865, 0.0133671755725191, -0.0021, 0.00947819548872178, 
-0.0242048327137546, 0.0511319391634981, -0.0454212996389891, 
-0.0168943396226415, -0.0287199233716475, -0.017348031496063, 
0.0182, -0.0015, 0.0340941176470589, 0.0213272727272727, 0.00240370370370376, 
NA, -0.0796460176991151, 0.102464102564103, -0.0989372093023255, 
-0.0936483870967742, -0.0677156583629893, 0.114403816793893, 
-0.0446205479452054, 0.0285738351254481, 0.0138372822299653, 
0.109865635738832, 0.114451083591331, -0.0723222222222222, -0.0390221556886228, 
-0.00321526479750779, 0.046875, -0.0686567164179105, -0.092948717948718, 
0.137809187279152, -0.109803921568628, 0.118942731277533, -0.0866141732283464, 
0.021551724137931, 0.0970464135021096, 0.0448717948717949, -0.0521472392638037, 
-0.0971873786407767, 0.0250896057347669, 0, -0.15044965034965, 
0.0204761316872428, -0.104938709677419, -0.0496495495495496, 
-0.0996260663507109, 0.142105263157895, -0.119815668202765, 0.0523560209424083, 
-0.0149253731343284, -0.0252525252525253, -0.16580310880829, 
0.118012422360248, 0.0166666666666666, 0.0163934426229508, 0.010752688172043, 
-0.0904255319148937, -0.0701754385964912, -0.0251572327044025, 
0.135483870967742, 0, -0.0209790209790209, -0.0714285714285714, 
-0.115384615384615, -0.0260869565217391, 0.0982142857142858, 
-0.130081300813008, 0.02803738317757, -0.0545454545454546, 0, 
-0.109677419354839, -0.130434782608696, -0.0666666666666667, 
0, -0.157142857142857, -0.0689655172413793, -0.0462962962962963, 
-0.00773358778625955, -0.0463538461538461, 0.00786451612903225, 
-1e-04, -0.0161, -0.105891056910569, 0.0998000000000001, 0.0493867768595042, 
0.0470440944881889, -0.00771879699248126, -0.136463636363636, 
-0.0178438596491229, 0.0353142857142858, -0.0176413793103449, 
0.0172438596491229, 0.0339827586206897, -0.0339333333333333, 
-0.0437034482758621, 0.026327027027027, -0.0710754385964912, 
-0.0103339622641509, -0.0485190476190477, -0.0587999999999999, 
-0.0561016985138004, 0.0191247191011236, -0.0649766519823788, 
-0.144729411764706, -0.0783230769230769, -0.0728285714285715, 
-0.0815282051282052, -0.127035540069686, -0.133074103585657, 
-0.0960176470588235, -0.0560568345323741, -0.127275285171103, 
-0.149081627296588, -0.0892524714828897, -0.156066666666667, 
0.160879510703364, -0.122452631578947, 0.0915143712574852, NA, 
-0.0886956521739131, -0.0268175572519084, -0.114854098360656, 
-1e-04, 0.0276777777777777, -0.0631630630630631, -0.0481769230769231, 
-0.0102010101010101, -0.0531612244897959, 0.0343827586206897, 
-0.00426666666666665, -0.0461251046025104, 0.0415666666666667, 
-0.116842105263158, 0.0715137067938021, -0.110122358175751, 0.0249999999999999, 
0.158436585365854, -0.00421052631578944, -0.101479915433404, 
0.0352941176470589, 0, -0.0113636363636364, -0.0114942528735632, 
0.0232558139534884, 0.00356972477064209, 0.0329067641681902, 
0.00884955752212391, 0.0700754385964912, 0.0162934426229508, 
0.096674193548387, -1e-04, -0.0295117647058824, -0.0303030303030303, 
0, 0, 0, 0.015625, 0, 0, 0.0384615384615385, -0.00740740740740742, 
-0.0328358208955224, -0.00462962962962965, 0.130232558139535, 
-0.0123456790123457, -0.0277777777777778, 0.1, 0.0714285714285714, 
0.175757575757576, -0.00515463917525771, 0.0611398963730569, 
0.03515625, -0.108490566037736, -0.0338624338624338, -0.0131434830230011, 
0.0288568257491675, -0.0258899676375405, 0.00775193798449614, 
-0.0109890109890109, 0, -0.0555555555555556, -0.0352941176470588, 
0.0317073170731708, 0.0401891252955082, 0.00681818181818183, 
-0.0519187358916479, -0.107142857142857, 0.133233333333333, -0.0706882352941176, 
-0.0141240506329114, -0.00661848523748401, 0.00635994832041352, 
0.0217228498074455, -0.00773768844221103, -0.0267822784810127, 
0.0440132639791937, 0.00851731008717314, 0.00350370370370376, 
0.00851008610086111, -0.0149341463414634, -0.00411287128712872, 
0.00208447204968949, -0.00897410161090454, -0.0255, 0.0109384615384615, 
0.0450273764258555, -0.0334272727272727, -0.025962656641604, 
-0.026606940874036, -0.0431163588390502, -0.0366126721763086, 
-0.0151857142857142, 0.0133927536231885, -0.0011, 0.00594285714285712, 
-0.136151773049645, 0.0559770491803278, -0.0014, -0.0016, 0.0139038759689923, 
-0.0473015267175572, 0.0301, -0.0483116279069767, -0.0100300813008131, 
0.0142934426229508, 0.0223935483870968, -0.0019, -0.0257220472440944, 
-0.0262935483870968, -0.0018, -0.0266933884297521, -0.060922033898305, 
-0.0738720720720721, -0.0209174757281553, -0.0150613861386139, 
-0.178106827309237, 0.130407317073171, NA, -0.0618336886993603, 
0.0794454545454546, 0.0314789473684211, -0.122548979591837, -0.00475116279069766, 
-0.00594112149532712, 0.0175263219741482, -0.0532177829099307, 
0.024290243902439, -0.056052380952381, 0.0503413619167718, -0.0685273709483794, 
-0.0490690721649485, 0.070360704607046, 0, -0.029113924050633, 
-0.0365058670143416, -0.00541271989174563, 0.0284714285714285, 
-0.0555555555555556, -0.0336134453781513, -0.063768115942029, 
-0.086687306501548, 0.123728813559322, -0.0253164556962026, -0.0909090909090909, 
0.0513274336283185, -0.0420875420875421, 0.0216983651226159, 
0.0265666666666666, -0.103996103896104, 0.0752623188405796, 0.0242587601078168, 
0.102631578947368, 0.121718377088305, -0.0853658536585366, -0.0580952380952381, 
0.0556117290192113, -0.0229885057471264, -0.0392156862745098, 
0.0265306122448981, 0.0735586481113319, -0.05, -0.00584795321637432, 
0.0686274509803921, 0.00550458715596336, 0.0109489051094891, 
0.0415162454873645, 0.050259965337955, 0.0297029702970297, 0.0657051282051282, 
0.018045112781955, -0.051698670605613, 0.0202492211838006, -0.0229007633587787, 
-0.00156250000000002, 0.0453834115805947, -0.0494011976047904, 
0.0692913385826772, -0.00589101620029453, -0.0237037037037037, 
0.0318664643399089, 0, -0.0176470588235295, -0.00748502994011979, 
-0.0271493212669683, 0.0200550387596898, -0.074568085106383, 
-0.0231885057471264, -0.0438974789915966, 0.0192321616871704, 
-0.0173413793103449, 0.00506315789473686, 0.036449214659686, 
0.0940760942760943, 0.0582615384615386, 0.118986046511628, -0.00919090909090904, 
0.0246017038007864, 0.153052685421995, -0.0746793791574279, 0.0535922155688624, 
0.1245, -0.0268626262626262, 0.0159975103734439, 0.0197081632653061, 
0.0831000000000001, -0.0654756457564576, -0.020623865877712, 
-8e-04, -0.0501957746478874, -0.0116820105820106, 0.0256379679144386, 
0.0404666666666667, -0.0214, -0.0371142857142857, -0.0014, -0.00689100529100535, 
-0.0707489361702128, 0.00992857142857134, -0.0527474576271186, 
-0.0672761904761905, -0.0273777070063694, -0.0936032679738562, 
-0.138490647482014, 0.0314333333333334, -0.0182290322580645, 
-0.0184934426229508, 0.0065333333333333, 0.0146289256198347, 
-0.074770731707317, 0.0508315789473684, -0.0015, 0.0071333333333333, 
0.0151289256198347, 0.0149601626016261, NA, -0.0815850815850816, 
-0.0863944162436549, 0.0415666666666667, -0.106766666666667, 
-0.0239805970149254, -0.0215067278287462, 0.059275, -0.0266486725663717, 
-0.0152515151515151, 0.0768230769230769, 0.0427571428571429, 
-0.106949315068493, 0.0520472392638036, -0.0234236151603499, 
-0.0149253731343284, 0.00909090909090904, 0.0210210210210211, 
-0.0588235294117647, -1e-04, -0.078125, -0.0305084745762711, 
-0.0909090909090909, -0.1, -0.0907407407407408, 0.0386965376782078, 
-0.125590196078431, -0.0582959641255605, 0.0857142857142856, 
0.0525315789473684, -0.0292666666666667, -0.0473103004291845, 
-0.121721621621622, -0.128305128205128, -0.0647058823529412, 
-0.0628930817610063, 0, 0.00671140939597326, -0.0133333333333333, 
0.0304054054054055, -0.0163934426229508, 0.133333333333333, 0, 
0.088235294117647, 0.164864864864865, -0.0672853828306265, 0.0223880597014925, 
0.0900243309002433, 0.142857142857143, -0.04296875, 0.0775510204081633, 
-0.0549242424242424, 0.0160320641282565, -0.00591715976331364, 
-0.0595238095238095, -0.0126582278481012, 0.0277777777777777, 
-0.027027027027027, -0.0427350427350427, 0.0334821428571428, 
-0.041036717062635, 0.072072072072072, -0.023109243697479, -0.0150537634408602, 
0, 0.00655021834061142, -0.0520607375271149, 0.0274599542334095, 
0.0289532293986636, 0.0691640692640694, -0.0102214574898786, 
0.0222948875255624, -0.0142, -0.0244407707910751, -0.0520750519750519, 
-0.0659894736842105, -0.00254741784037562, 0.122152941176471, 
0.050114465408805, 0.0177640718562875, 0.031272549019608, -0.0170666666666667, 
-0.107210039113429, 0.0856313868613138, 0.0410666666666667, -0.056083870967742, 
0.0293546448087431, -0.014162599469496, 0.0419893905191874, -0.0375965367965368, 
-0.0391022471910113, 0.0316102803738317, 0.00794977375565608, 
0.0391587443946187, 0.0115310344827587, -0.0311872340425532, 
-0.0145578947368421, 0.0161777777777777, 0.00276681222707414, 
0.0202391304347827, -0.0657297872340425, -0.010890909090909, 
-0.020248623853211, 0.00724579439252326, -0.0295777777777778, 
0.00286190476190475, -0.035275355450237, 0.0175078431372548, 
-0.0546846153846154, -0.0323568527918782, -0.0330136125654451, 
0.00360540540540535, 0.020005376344086, -0.0801473684210527, 
0.0157428571428571, 0.0155539325842696, NA, 0.0446428571428572, 
-0.0513820512820513, -0.0631630630630631, -0.0654846153846154, 
0.00813045267489708, -0.00418163265306127, -0.180427868852459, 
0.1049, -0.0589235294117647, -0.122696153846154, 0.021817808219178, 
0.13931018766756, 0.0516647058823529, -0.125379642058166, -0.0153452685421995, 
0.025974025974026, -0.0151898734177216, -0.017994858611825, -0.036749214659686, 
-0.0624999999999999, -0.0434782608695652, 0, 0.0606060606060606, 
0, 0.114285714285714, -0.0769230769230769, -0.0416666666666666, 
0.0288855072463767, -0.0422535211267606, -0.0294117647058824, 
0.0756575757575757, -0.0423535211267606, 0.0293117647058822, 
-0.1001, 0.0792650793650793, 0.102941176470588, -0.0613333333333332, 
0.0235294117647058, -0.0114942528735632, 0.13953488372093, -0.0346938775510205, 
-0.0380549682875264, -0.0527472527472527, 0, -0.0255220417633411, 
0.0428571428571427, -0.0593607305936071, -0.0412621359223302, 
-0.0303797468354431, -0.00783289817232369, 0.0105263157894737, 
-0.0651041666666666, -0.00278551532033433, 0.0307262569832403, 
-0.0948509485094851, 0.00299401197604787, 0.0149253731343284, 
-0.0382352941176469, -0.0336391437308869, 0.0379746835443036, 
-0.0853658536585366, 0, 0.03, 0, -0.00323624595469252, -0.0194805194805195, 
0, 0.0132450331125828, 0.0196078431372548, -0.0385615384615384, 
-1e-04, 0.0264666666666666, 0.0127870129870129, -0.0225358974358975, 
0.0818672131147542, -0.0395939393939394, -0.0191274447949526, 
0.044816077170418, 0.0551846153846154, -0.0118618075801749, 0.00284985250737478, 
0.00264117647058822, 0.0993067448680351, 0.0822666666666667, 
-0.111137438423645, -0.00327008310249316, -6e-04, -0.0144888888888888, 
0.0133845070422535, 0.0129888888888888, 0.0127986301369864, 0.00180270270270268, 
0.0369358490566038, -9e-04, -0.040061038961039, 0.025927027027027, 
0.0251157894736843, -0.0629384615384615, -0.0287224043715847, 
-0.0182539325842697, -0.0587428571428572, 0.101430303030303, 
-0.00699450549450536, -0.106872375690608, 0.0475827160493827, 
-0.0548411764705882, 0.159390683229814, -0.0873614973262031, 
0.00394795321637421, 0.102551162790698, -0.0231526315789473, 
-0.0824451612903226, 0.12090701754386, -0.0120166666666666, -0.0281157894736842, 
-0.0015, 0.0096108108108107, 0.0627711229946524, -0.066626633165829, 
NA, -0.05, 0.0512157894736842, -0.048911013767209, -0.0685210526315789, 
0.172216384180791, -0.0241963855421686, -0.0618283950617285, 
0.0525315789473684, -0.00259999999999995, 0.0525315789473684, 
0.0118047619047619, -1e-04, 0.0304882352941176, 0.0387127853881279, 
-0.0384615384615384, 0.04, -0.021978021978022, -0.0561797752808989, 
-1e-04, -0.0238095238095238, 0.024390243902439, 0.0476190476190477, 
0.0772727272727274, -0.0295358649789029, 0.0326086956521738, 
0.0210526315789474, -0.0123711340206185, -0.0606427974947808, 
0.108888888888889, -0.0581162324649298, 0.0105382978723405, -1e-04, 
-0.0737842105263158, 0.0271727272727273, -0.00452477876106195, 
0.0222222222222221, -0.0152173913043478, -0.00662251655629142, 
0, 0.00555555555555554, -0.00331491712707177, 0.0565410199556542, 
-0.0451206715634838, 0.0879120879120878, -0.0909090909090909, 
0.0222222222222221, 0.0326086956521738, 0.11578947368421, -0.0415094339622641, 
-0.015748031496063, -0.023, 0.105424769703173, -0.0611111111111111, 
0.0157790927021697, -0.0485436893203883, 0.0265306122448981, 
-0.104373757455268, 0.1165371809101, 0.0318091451292246, 0.0385356454720616, 
-0.0575139146567718, 0.0925196850393701, 0, -0.0720720720720721, 
0.029126213592233, 0.00943396226415105, -0.0186915887850467, 
-0.123809523809524, 0.0652173913043479, -0.122448979591837, -0.0117279069767442, 
-0.028335294117647, -0.0679966101694916, 0.0387610389610389, 
-1e-04, -0.0251, 0.00877435897435894, -0.00909453621346892, -0.0143025641025641, 
0.0141042912873863, -0.0386615384615384, 0.0132333333333334, 
0.112857894736842, 0.0279687943262412, -0.0532735632183908, 0.0361077669902914, 
0.043996487119438, -0.0499273542600897, 0.0135509433962264, 0.0225558139534884, 
-0.0463545454545454, 0.0229095238095237, -9e-04, -0.0217302325581395, 
0.0608577197149644, -0.0167599552572707, -0.0283727272727272, 
-0.0105457943925234, -0.0344188679245283, 0.0717707317073171, 
0.0258727272727273, 0.0470725663716814, -0.0522329113924051, 
-0.0015, -0.0641222222222222, 0.0740293838862558, -0.054763436123348, 
0.0118534883720931, 0.0394844036697249, -0.0459528634361234, 
-0.00670829493087556, 0.0210481481481481, -0.0198995475113123, 
0.030358064516129, -0.0685642857142857, 0.0364775119617225, 0.030758064516129, 
0.00326428571428581, 0.0119333333333334, -0.00568596491228072, 
NA, -0.0833333333333334, 0.0908090909090908, -0.1501, -0.0687274509803921, 
-0.0527315789473685, -1e-04, 0.0546945205479452, -0.116983116883117, 
-0.0736294117647058, 0.0395825396825398, 0.00753358778625944, 
-0.121312121212121, 0.0343827586206897, 0.075, -0.00775193798449614, 
0.015625, -0.123076923076923, 0.0963912280701753, 0, -0.0640000000000001, 
0.0256410256410258, 0.15, -0.0942028985507247, -0.00800000000000001, 
0.120967741935484, -0.064748201438849, 0.0537461538461539, 0, 
0.0729927007299269, -0.142957142857143, 0.0713285714285714, 0.036937037037037, 
0.0713285714285714, -0.0750000000000001, -0.00900900900900903, 
-0.0454545454545454, 0.142857142857143, -0.166666666666667, 0, 
0.12, -0.142857142857143, 0.104166666666667, 0.0566037735849056, 
-0.0267857142857142, -0.0733944954128442, 0.0495049504950495, 
-0.0377358490566038, 0.0490196078431373, 0.121495327102804, 0, 
-0.0158730158730158, 0.0161290322580645, -0.158730158730159, 
-0.150943396226415, 0.111111111111111, 0.01, 0.0693069306930694, 
0.0833333333333333, 0.111111111111111, -0.0461538461538461, 0, 
-0.0403225806451613, 0.00840336134453779, -0.0750000000000001, 
0.0180180180180181, -0.0353982300884956, 0.100817431192661, -0.0751000000000001, 
-0.150575939849624, -0.0266486725663717, 0.127172727272727, 0.032058064516129, 
0.015425, 0.122876923076923, 0.0134986301369864, 0.114664864864865, 
0.0180818181818183, 0.160414285714286, 0.148317948717949, 0.0531714285714286
), `Mkt-RF` = c(-0.0528, -0.021, 0.0641, -0.0166, -0.1206, -0.0097, 
0.1188, -0.0426, 0.1156, 0.0498, -0.0803, 0.0904, 0.0368, 0.0306, 
-0.0017, 0.0814, -0.0306, -0.0205, -0.0333, -0.1011, -0.1161, 
0.1097, -0.0221, 0.0569, 0.0641, 2e-04, -0.0223, -0.1231, 0.0713, 
0.0056, 0.045, 0.0349, 0.0166, 0.0227, 0.0338, 0.062, -0.0249, 
-0.0054, 0.0416, 0.0106, -0.0464, 0.0745, -0.007, 0.0704, 0.0449, 
0.0133, 0.0237, -0.0303, 0.0742, -0.0055, 0.0177, 0.0077, -0.0012, 
-0.041, -2e-04, -0.0379, -0.027, 0.0212, -0.037, -0.003, 0.0621, 
-0.0228, 0.0479, -0.0015, -0.0284, 0.0239, -0.0602, -0.0427, 
0.0619, -0.0149, -0.0186, -0.0643, -0.0171, 0.067, 0.0238, -0.0038, 
-0.0501, 0.0444, 0.0077, 0.0095, -0.0308, -0.025, 0.0472, 0.0284, 
0.0068, 0.0427, 0.0463, 0.0503, -0.0067, 0.0349, 0.0011, 0.0272, 
0.0059, -1e-04, 0.0147, 0.0552, -0.0535, -0.0071, 0.022, -0.0273, 
-0.0092, 0.0269, -0.0265, 0.0012, -0.0854, -0.0131, -0.0459, 
0.0619, 0.0293, 0.0058, 0.037, -0.0534, 0.0587, -0.0256, -0.0239, 
0.0215, 0.0326, 0.0178, 0.0407, -0.0255, -0.0528, -0.021, 0.0641, 
-0.0166, -0.1206, -0.0097, 0.1188, -0.0426, 0.1156, 0.0498, -0.0803, 
0.0904, 0.0368, 0.0306, -0.0017, 0.0814, -0.0306, -0.0205, -0.0333, 
-0.1161, 0.1097, -0.0485, -0.0221, 0.0569, 2e-04, -0.0223, -0.1231, 
0.0713, 0.0056, 0.045, 0.0349, 0.0166, 0.0227, 0.0338, 0.062, 
-0.0249, -0.0054, 0.0416, 0.0106, -0.0464, 0.0745, -0.007, 0.0704, 
0.0449, 0.0133, 0.0237, -0.0303, 0.0742, -0.0055, 0.0077, -0.0012, 
-0.041, -2e-04, -0.0379, -0.027, 0.0212, -0.037, -0.003, 0.0479, 
-0.0015, -0.0284, 0.0239, -0.0602, 0.0619, -0.0149, -0.0643, 
-0.0171, 0.067, 0.0238, -0.0038, -0.0501, 0.0444, 0.0077, 0.0095, 
-0.0308, -0.025, 0.0472, 0.0284, 0.0068, 0.0427, 0.0463, 0.0503, 
-0.0067, 0.0349, 0.0011, 0.0272, 0.0059, -1e-04, 0.0147, 0.0552, 
-0.0535, -0.0071, 0.022, -0.0273, -0.0092, 0.0269, -0.0265, -0.0854, 
0.0619, 0.0293, 0.037, 0.0587, -0.0256, 0.0178, 0.0407, -0.0255, 
-0.0528, -0.021, 0.0641, -0.1206, -0.0097, 0.1188, -0.0426, 0.1156, 
0.0498, -0.0803, 0.0904, 0.0368, 0.0306, -0.0017, 0.0814, -0.0306, 
-0.0205, -0.0333, -0.1011, -0.1161, 0.1097, -0.0485, -0.0221, 
0.0569, 0.0641, 2e-04, -0.1231, 0.0713, 0.0056, 0.045, 0.0349, 
0.0166, 0.0227, 0.0338, 0.062, -0.0249, -0.0054, 0.0416, 0.0106, 
-0.0464, 0.0745, -0.007, 0.0704, 0.0449, 0.0133, 0.0237, -0.0303, 
0.0742, -0.0055, 0.0177, 0.0077, -0.0012, -0.041, -2e-04, -0.0379, 
-0.027, 0.0212, -0.037, -0.003, 0.0621, -0.0228, 0.0479, -0.0015, 
-0.0284, 0.0239, -0.0602, -0.0427, 0.0619, -0.0149, -0.0186, 
-0.0643, -0.0171, 0.067, 0.0238, -0.0038, -0.0501, 0.0444, 0.0077, 
0.0095, -0.0308, -0.025, 0.0472, 0.0284, 0.0068, 0.0427, 0.0463, 
0.0503, -0.0067, 0.0349, 0.0011, 0.0272, 0.0059, -1e-04, 0.0147, 
0.0552, -0.0535, -0.0071, 0.022, -0.0273, -0.0092, 0.0269, -0.0265, 
0.0012, -0.0854, -0.0131, -0.0459, 0.0619, 0.0293, 0.0058, 0.037, 
-0.0534, 0.0587, -0.0256, -0.0239, 0.0215, 0.0326, 0.0178, 0.0407, 
-0.0255, -0.0528, -0.021, 0.0641, -0.0166, -0.1206, -0.0097, 
0.1188, -0.0426, 0.1156, 0.0498, -0.0803, 0.0904, 0.0368, 0.0306, 
-0.0017, 0.0814, -0.0306, -0.0205, -0.0333, -0.1011, -0.1161, 
0.1097, -0.0485, -0.0221, 0.0569, 2e-04, -0.0223, 0.0713, 0.0056, 
0.0349, 0.0166, 0.0227, 0.0338, 0.062, -0.0249, -0.0054, 0.0106, 
-0.0464, 0.0745, -0.007, 0.0704, 0.0449, 0.0133, 0.0237, -0.0303, 
0.0742, -0.0055, 0.0177, 0.0077, -0.0012, -0.041, -2e-04, -0.0379, 
-0.027, 0.0212, -0.037, -0.003, 0.0621, -0.0228, 0.0479, -0.0015, 
-0.0284, 0.0239, -0.0602, -0.0427, 0.0619, -0.0149, -0.0186, 
-0.0643, -0.0171, 0.067, 0.0238, -0.0038, -0.0501, 0.0444, 0.0077, 
0.0095, -0.0308, -0.025, 0.0472, 0.0284, 0.0068, 0.0427, 0.0463, 
0.0503, -0.0067, 0.0349, 0.0011, 0.0272, 0.0059, -1e-04, 0.0147, 
0.0552, -0.0535, -0.0071, 0.022, -0.0273, -0.0092, 0.0269, -0.0265, 
0.0012, -0.0854, -0.0131, -0.0459, 0.0619, 0.0293, 0.0058, 0.037, 
-0.0534, 0.0587, -0.0256, -0.0239, 0.0215, 0.0326, 0.0178, 0.0407, 
-0.0255, -0.0528, -0.021, 0.0641, -0.0166, -0.1206, -0.0097, 
0.1188, -0.0426, 0.1156, 0.0498, -0.0803, 0.0904, 0.0368, 0.0306, 
-0.0017, 0.0814, -0.0306, -0.0205, -0.0333, -0.1011, -0.1161, 
0.1097, -0.0485, 0.0569, 2e-04, -0.0223, -0.1231, 0.0713, 0.0056, 
0.045, 0.0349, 0.0166, 0.0227, 0.0338, 0.062, -0.0249, -0.0054, 
0.0416, 0.0106, -0.0464, 0.0745, -0.007, 0.0704, 0.0449, 0.0133, 
0.0237, -0.0303, 0.0742, -0.0055, 0.0177, 0.0077, -0.0012, -0.041, 
-2e-04, -0.0379, -0.027, 0.0212, -0.037, -0.003, 0.0621, -0.0228, 
0.0479, -0.0015, -0.0284, 0.0239, -0.0602, -0.0427, 0.0619, -0.0149, 
-0.0186, -0.0643, -0.0171, 0.067, 0.0238, -0.0038, -0.0501, 0.0444, 
0.0077, 0.0095, -0.0308, -0.025, 0.0068, 0.0427, 0.0463, 0.0503, 
-0.0067, 0.0349, 0.0011, 0.0059, -1e-04, 0.0147, 0.0552, -0.0535, 
-0.0071, 0.022, -0.0273, -0.0092, 0.0269, -0.0265, 0.0012, -0.0854, 
-0.0131, -0.0459, 0.0619, 0.0293, 0.0058, 0.037, -0.0534, 0.0587, 
-0.0256, -0.0239, 0.0215, 0.0326, 0.0178, 0.0407, -0.0255, -0.0528, 
-0.021, 0.0641, -0.0166, -0.1206, -0.0097, 0.1188, -0.0426, 0.1156, 
0.0498, -0.0803, 0.0904, 0.0368, 0.0306, -0.0017, 0.0814, -0.0306, 
-0.0205, -0.0333, -0.1011, -0.1161, 0.1097, -0.0485, -0.0221, 
0.0569, 0.0641, 2e-04, -0.0223, -0.1231, 0.0713, 0.0056, 0.045, 
0.0349, 0.0166, 0.0227, 0.0338, 0.062, -0.0249, 0.0416, 0.0106, 
-0.0464, 0.0745, -0.007, 0.0704, 0.0449, 0.0133, 0.0237, -0.0303, 
0.0742, -0.0055, 0.0177, 0.0077, -0.0012, -0.041, -2e-04, -0.0379, 
-0.027, 0.0212, -0.037, -0.003, 0.0621, -0.0228, 0.0479, -0.0015, 
-0.0284, 0.0239, -0.0602, -0.0427, 0.0619, -0.0149, -0.0186, 
-0.0643, -0.0171, 0.067, 0.0238, -0.0038, -0.0501, 0.0444, 0.0077, 
0.0095, -0.0308, -0.025, 0.0472, 0.0284, 0.0068, 0.0427, 0.0463, 
0.0503, -0.0067, 0.0349, 0.0011, 0.0272, 0.0059, -1e-04, 0.0147, 
0.0552, -0.0535, -0.0071, 0.022, -0.0273, -0.0092, 0.0269, -0.0265, 
0.0012, -0.0854, -0.0131, -0.0459, 0.0619, 0.0293, 0.0058, 0.037, 
-0.0534, 0.0587, -0.0256, -0.0239, 0.0215, 0.0326, 0.0178, 0.0407, 
-0.0255, -0.0528, -0.021, 0.0641, -0.0166, -0.1206, -0.0097, 
0.1188, -0.0426, 0.1156, 0.0498, -0.0803, 0.0904, 0.0368, 0.0306, 
-0.0017, 0.0814, -0.0306, -0.0205, -0.0333, -0.1011, -0.1161, 
0.1097, -0.0485, -0.0221, 0.0569, 0.0641, 2e-04, -0.0223, -0.1231, 
0.0713, 0.0056, 0.045, 0.0349, 0.0166, 0.0227, 0.0338, 0.062, 
-0.0249, -0.0054, 0.0416, 0.0106, -0.0464, 0.0745, -0.007, 0.0704, 
0.0449, 0.0133, 0.0237, -0.0303, 0.0742, -0.0055, 0.0177, 0.0077, 
-0.0012, -0.041, -2e-04, -0.0379, -0.027, 0.0212, -0.037, -0.003, 
0.0621, -0.0228, 0.0479, -0.0015, -0.0284, 0.0239, -0.0602, -0.0427, 
0.0619, -0.0149, -0.0186, -0.0643, -0.0171, 0.067, 0.0238, -0.0038, 
-0.0501, 0.0444, 0.0077, 0.0095, -0.0308, -0.025, 0.0472, 0.0284, 
0.0068, 0.0427, 0.0463, 0.0503, -0.0067, 0.0349, 0.0011, 0.0272, 
0.0059, -1e-04, 0.0147, 0.0552, -0.0535, -0.0071, 0.022, -0.0273, 
-0.0092, 0.0269, -0.0265, 0.0012, -0.0854, -0.0131, -0.0459, 
0.0619, 0.0293, 0.0058, 0.037, -0.0534, 0.0587, -0.0256, -0.0239, 
0.0215, 0.0326, 0.0178, 0.0407, -0.0255, -0.0528, -0.021, 0.0641, 
-0.0166, -0.1206, -0.0097, 0.1188, 0.1156, 0.0498, -0.0803, 0.0904, 
0.0368, 0.0306, -0.0017, 0.0814, -0.0306, -0.0205, -0.0333, -0.1011, 
-0.1161, 0.1097, -0.0485, -0.0221, 0.0569, 0.0641, 2e-04, -0.0223, 
-0.1231, 0.0713, 0.0056, 0.045, 0.0349, 0.0227, 0.0338, 0.062, 
-0.0249, -0.0054, 0.0416, 0.0106, -0.0464, 0.0745, -0.007, 0.0704, 
0.0449, 0.0133, 0.0237, -0.0303, 0.0742, -0.0055, 0.0177, -0.041, 
-2e-04, -0.0379, -0.027, 0.0212, -0.037, -0.003, 0.0621, -0.0228, 
0.0479, -0.0015, -0.0284, 0.0239, -0.0602, -0.0427, 0.0619, -0.0149, 
-0.0186, -0.0643, 0.067, 0.0238, -0.0038, -0.0501, 0.0444, 0.0077, 
0.0095, -0.0308, -0.025, 0.0472, 0.0284, 0.0068)), class = c("tbl_df", 
"tbl", "data.frame"), row.names = c(NA, -900L))

A:

This code works:
CombData <- CombData[order(CombData$ISIN),]
CombData2 <- unlist(CombData$ExReturn)
CombData3 <- unlist(CombData$`Mkt-RF`)
risk <- matrix(data = NA, 14660, ncol = 3)
for (i in 1:14657) {
  j <- i+3
 risk[j,1] <- cov(CombData[i:j,c(72)],CombData[i:j,c(79)])/var(CombData[i:j,c(79)])
 reg_risk <- lm(CombData2[i:j, 1] ~ CombData3[i:j, 1], na.action = na.fail)
 risk[j,2] <- sigma(reg_risk)
 risk[j,3] <- sd(CombData2[i:j, ])
}

