decode – How to convert a list of ICD9 and ICD10 codes into their meaning (English names) in R?

I have a list of ICD9 AND ICD10 codes like this:





I want to decode these to English (to the actual name of the diseases). I thought of using the ICD package in R, especially the “explain_table()” function but it’s only decoding either the ICD9 codes or the ICD10 codes. Not the two at the same time. I am getting this:

Sebaceous cyst



Symptoms involving skin and other integumentary tissue

It seems the type of ICD code of the first element in the list will decide what kind of code will be translated. In my example, the first one was an ICD9 code so only the ICD9 codes were translated. The two ICD10 codes in the middle were not.