We change the LC_COLLATE variable to make sure that R sorts according to ASCII rules, which is what C++ will use. Otherwise the named_vector will not work.