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

col_factor() that automatically figures out levels #497

Closed
tvedebrink opened this issue Aug 1, 2016 · 1 comment
Closed

col_factor() that automatically figures out levels #497

tvedebrink opened this issue Aug 1, 2016 · 1 comment
Labels
feature a feature request or enhancement

Comments

@tvedebrink
Copy link
Contributor

tvedebrink commented Aug 1, 2016

A nice feature to the col_factor() function in col_types would be to allow empty arguments.
This should be treated similar to data$variable <- factor(data$variable) on character variables after using read_csv. That is, col_factor() would be stringsAsFactors=TRUE for the specific variables/columns.

@hadley hadley added collector feature a feature request or enhancement labels Dec 22, 2016
jimhester added a commit that referenced this issue Feb 9, 2017
This allows one to generate factor levels based on the data

Fixes #497
jimhester added a commit that referenced this issue Feb 22, 2017
This allows one to generate factor levels based on the data

Fixes #497
@tvedebrink
Copy link
Contributor Author

tvedebrink commented Mar 14, 2017

Perfect - works like a charm
read_csv("x,y\n1,A\n2,B", col_types = list(col_double(),col_factor(NULL)))

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature a feature request or enhancement
Projects
None yet
Development

No branches or pull requests

2 participants