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

TO READ: should_advise(...) #11

Closed
garrettgman opened this issue Jun 29, 2009 · 5 comments
Closed

TO READ: should_advise(...) #11

garrettgman opened this issue Jun 29, 2009 · 5 comments

Comments

@garrettgman
Copy link
Member

We should add a message to ymd( ) that appears depending on where ymd(
) is being used. The message reveals what format is being used.

ymd(..., advice = should_advise(...))

@garrettgman
Copy link
Member Author

Do you remember what should_advise was advising people? I think it had something to do with where ymd() was called... it looks at the arguments and then either advises or doesn't advise based on what they are...

@hadley
Copy link
Member

hadley commented Jul 2, 2009

Two main uses for ymd etc.

  • to create one or two dates for comparison: subset(df, date < ymd(20010405))
  • to convert a whole lot of dates from character: df$date <- ymd(df$date)

In the first one don't want any feedback by default, but in the second you do.

@garrettgman
Copy link
Member Author

The should advise function was unnecessary. We had parse date always executing
message("Using date format ", fmt, ".")
whenever ymd() was called. I changed it to
if (length(x) > 1) message("Using date format ", fmt, ".")
so it would only display the message if ymd() was evaluating more than one date at a time. This does the same thing that the should_advise() function would have

@hadley
Copy link
Member

hadley commented Jul 7, 2009

I'd make it > 2, but otherwise great :)

@garrettgman
Copy link
Member Author

I changed it

This issue was closed.
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

2 participants