Historical Decomposition of SVAR Model in R

Apologies if I'm not allowed to post a question on here from another platform, I'll remove this if that's the case.

I've have run an SVAR Model, and I'm interested in constructing a historical decomposition of shocks to the variables in my model. I had posted my question on stackexchange (see https://stats.stackexchange.com/questions/503334/historical-decomposition-on-svar-model-in-r), but I'm wondering whether anyone here has done something similar and has advice on how to approach this?

TIA! Once again, apologies if my request is not allowed on here.

Cross-posting is OK as long as you follow the forum's guidelines (which includes not just dropping a link to another help site)

Thanks @andresrcs , I'll avoid cross posting in the future. Might've found a solution to my problem anyway so I'll post it if anyone wants to replicate in the future