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

Comments

@tvedebrink
Copy link
Contributor

@tvedebrink 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.

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
@jimhester jimhester closed this in d3cdcd2 Feb 22, 2017
@tvedebrink
Copy link
Contributor Author

@tvedebrink 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.
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants