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

leading space in clean_names becomes an x #85

Closed
sfirke opened this issue Jan 5, 2017 · 1 comment
Closed

leading space in clean_names becomes an x #85

sfirke opened this issue Jan 5, 2017 · 1 comment

Comments

@sfirke
Copy link
Owner

sfirke commented Jan 5, 2017

> dat <- data.frame(1)
> names(dat)[1] <- " my interview"
> clean_names(dat)
  x_my_interview
1              1

Preferably would just be stripped off.

@sfirke sfirke closed this as completed in ec9916f Jan 8, 2017
@sfirke
Copy link
Owner Author

sfirke commented Jan 8, 2017

my fix was simple, it handles spaces only - other leading illegal name characters will still cause make.names() to turn them into x. Say, the above example but with a leading !. But, (a) those are rarer cases and (b) there is arguably meaning encoded in non-space leading characters like an asterisk or exclamation point that is retained by the x. So this is good enough for now.

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

1 participant