countrycode icon indicating copy to clipboard operation
countrycode copied to clipboard

Distribute custom dictionaries with the package?

Open vincentarelbundock opened this issue 1 year ago • 1 comments

A lot of packages distribute data.

Would it make sense for us to distribute a few small custom dictionaries to make people's life easier. For example, it would be nice to distribute the usstates dictionary so that users could do:

library(countrycode)
countrycode("Alabama", "state", "stateabb", custom_dict = usstates)

The main downside is download size.

What do you think?

vincentarelbundock avatar Aug 24 '22 20:08 vincentarelbundock

I back that. The compressed codelist.rda file is only 242 KB with 288 rows × 621 columns, and presumably most of these custom dictionaries would be much, much smaller.

cjyetman avatar Sep 04 '22 08:09 cjyetman

The upcoming CRAN release has a new get_dictionary() function. See: https://vincentarelbundock.github.io/countrycode/#custom-dictionaries-and-cross-walks-get_dictionary-and-custom_dict

vincentarelbundock avatar May 30 '23 13:05 vincentarelbundock