five firm concentration ratio

Is there any package or code to calculate the five firm Concentration ratio in R?

I really appreciate any help you can provide.