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

additional warnings at point of factor creation #15

Closed
lorenzwalthert opened this issue Sep 24, 2016 · 0 comments
Closed

additional warnings at point of factor creation #15

lorenzwalthert opened this issue Sep 24, 2016 · 0 comments

Comments

@lorenzwalthert
Copy link
Collaborator

The following behaviour of cfactor is undesirable:

Duplicate levels

cfactor(c("a", "b"), levels = c("a", "a", "b")) yields a warning message that duplicated factor levels are depreciated. However, they are created anyways. This should not happen. Instead, before factor is called, we should remove duplicates from levels and issue a warning, saying duplicate levels were removed.

Confounding around underlying values x, labels and levels

It is actually possible to do the following without getting a warning:
factor(letters, levels = letters, labels = sample(letters)). Here, we essentially map a value x_i to an arbitrary value y_i with y_i is an element of X = (x_1, ... x_n). For most situations, this is probably not what the user wanted. It should at least cause a warning.

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

No branches or pull requests

1 participant