linelist icon indicating copy to clipboard operation
linelist copied to clipboard

guess_dates should accept vector of column names in clean_dates

Open scottyaz opened this issue 5 years ago • 5 comments

It would be helpful to also allow for character vector specifying column names (or even in tidy notation col_a:col_m. Note this is not a bug.

scottyaz avatar May 24 '19 12:05 scottyaz

guess_dates() explicitly works on vectors. Would this not be taken care of by the clean_dates() function, which wraps guess_dates()?

zkamvar avatar May 24 '19 12:05 zkamvar

Sorry, I meant the guess_dates argument of clean_dates seems to only accept logical or numeric vectors. Its easy enough to figure out which column numbers we want but would make it easier for many to just be able to specify the names of the columns.

scottyaz avatar May 24 '19 12:05 scottyaz

Not entirely sure how straightforward the added feature would be. @zkamvar do you think this belong to the prep of release 0.1.0 or shall we put a pin in it for later releases?

For what it's worth, an easy workaround would be, e.g. with dates columns containing the date character string:

x %>% 
  clean_data() %>% 
  mutate_at(vars(contains("date")), guess_dates, error_tolerance = 1)

Assuming a default guess_dates = FALSE in clean_data, cf PR https://github.com/reconhub/linelist/pull/103

thibautjombart avatar Nov 12 '19 16:11 thibautjombart

Because there is a workaround, I would be much happier to put this on the backburner.

zkamvar avatar Nov 14 '19 11:11 zkamvar

Because there is a workaround, I would be much happier to put this on the backburner.

Perf, untagging this from the project for the first release, and we can always get to this later.

@scottyaz most welcome to PR this if you feel like it ;)

thibautjombart avatar Nov 14 '19 11:11 thibautjombart