Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

get_characters() returns columns in different ordering than the list of char objects #242

Open
hlapp opened this issue Jun 18, 2019 · 1 comment

Comments

@hlapp
Copy link
Contributor

hlapp commented Jun 18, 2019

More specifically, for a nexml object nex, the lists resulting from

sapply(nex@characters[[1]]@format@char, slot, "label")

and

colnames(get_characters(nex))

will be set equal, but for any index i, their values at that index will be different.

Often this is not terribly problematic because in practice labels are usually unique, and so reordering by label matching will work.

However, labels are not required to be unique. If they aren't unique, according to documentation get_characters() will use the character IDs, which will be unique. But then ones has to know for reordering whether to match against the "id" or "label" slots of character objects.

So long story short, I want to argue for a preserveOrder or similar parameter for get_characters(), whose default value would be FALSE.

@cboettig
Copy link
Member

yeah, good call, preserveOrder seems like a reasonable way to deal with this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants