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

Output in examples #456

Closed
hadley opened this issue Aug 2, 2016 · 4 comments
Closed

Output in examples #456

hadley opened this issue Aug 2, 2016 · 4 comments

Comments

@hadley
Copy link
Member

hadley commented Aug 2, 2016

e.g. in coercion.r, why do we have the output pasted into the examples?

#' dt_utc <- ymd_hms("2010-08-03 00:50:50")
#' dt_europe <- ymd_hms("2010-08-03 00:50:50", tz="Europe/London")
#' c(as_date(dt_utc), as.Date(dt_utc))
#' ## [1] "2010-08-03" "2010-08-03"

This seems like an easy way to end up with code and results out of sync.

@vspinu
Copy link
Member

vspinu commented Aug 2, 2016

That's a custom for lubridate. I don't think it was me who started it, I think I just followed on the style. While it's a bit tedious to maintain it's surely convenient for the user. Deleting those comments would be wasteful IMO, especially now when the API is stable.

@hadley
Copy link
Member Author

hadley commented Aug 3, 2016

I think it's a bad idea because it's inconsistent with other packages, and there are definitely already differences between the output and the comment. Good writing/coding involves being willing to delete stuff that no longer works.

@vspinu
Copy link
Member

vspinu commented Aug 3, 2016

When viewed online or in a pdf printout this inline output is definitely useful. Many people are still printing doc pages (I see it all the time with my students).

I personally wouldn't care as I can execute and edit code directly form the help page in ESS. In other editors you cannot do that and people have to peruse the help page or have to run examples(...).

In any case, if you feel strongly about it then let's remove them. It would save me some time in the future. Manually pasting output is not the most pleasant activity.

@hadley
Copy link
Member Author

hadley commented Aug 8, 2016

I have some free time I'll have a go at removing it. It's not very high priority, but I think it's worthwhile.

@vspinu vspinu closed this as completed in 654c8ee Aug 17, 2016
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