-
Notifications
You must be signed in to change notification settings - Fork 286
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
Need some way to specify that you only want certain columns #72
Comments
Since I'm just starting to look into readr, it might be that I'm unaware of some existing features of the package, so please forgive me if that's the case. If not, have a look at how I do it in readDataFrame(pathname, colClasses=c("*"="NULL", "(x|y)"="integer", "char"="character")) Here In your case I can imagine something like: read_tsv(pathname, col_types=list("*"=col_skip(), x=col_integer(), y=col_integer(), char=col_character())) An alternative is to let an empty name represent the default behavior. You could also extend read_tsv(pathname, col_types=c("*"="_", x="i", y="i", char="c")) such that it expands to the above list. With empty name for default, you'd have: read_tsv(pathname, col_types=c("_", x="i", y="i", char="c")) |
I'm not a big fan of overloading column names with additional structure. What happens if there is a column called |
That's why I proposed the empty-name alternative. Of course, then there could be empty column names as well. Using regular expressions handles it all, but you'd need to escape. |
??
The text was updated successfully, but these errors were encountered: