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

Advertise reprex #69

Closed
krlmlr opened this Issue Jan 23, 2017 · 8 comments

Comments

Projects
None yet
3 participants
@krlmlr
Member

krlmlr commented Jan 23, 2017

Have you considered inserting a comment # Created on ${date} using the reprex package at the top or the bottom of the output? Both as a quality indicator and a hint to users who don't know the package yet.

@hadley

This comment has been minimized.

Member

hadley commented Sep 18, 2017

I like this idea too.

@hadley hadley closed this Sep 18, 2017

@hadley hadley reopened this Sep 18, 2017

jennybc added a commit that referenced this issue Oct 11, 2017

@jennybc

This comment has been minimized.

Member

jennybc commented Oct 11, 2017

@krlmlr Is this what you had in mind? Here's the output of reprex(mean(rnorm(3))) under the above PR:


mean(rnorm(3))
#> [1] -0.6492532
reprex::reprex_info()
#> Created on Tue Oct 10 23:00:27 2017 with the reprex package

This might look a little silly -- why not just include the output? It's not easy to get knitr to format this chunk like the others if it includes no code, e.g. if echo = FALSE. Hence the reprex_info() function.

I can't decide if advertise should default to TRUE or FALSE 🤔

@hadley

This comment has been minimized.

Member

hadley commented Oct 11, 2017

Maybe put it at the top? So it's more easily skimmed past? Use ISO8601? 😉

reprex::reprex_info()
#> Created by the reprex package; 2017-10-10

mean(rnorm(3))
#> [1] -0.6492532

I think it makes sense to include by default. It only adds 3 lines, is easily deleted if you don't want it, and provides useful information.

@jennybc

This comment has been minimized.

Member

jennybc commented Oct 12, 2017

OK @hadley how's this? Use of echo at all is detrimental to GFM, so I moved the ad into prose, to the top, and ISO8601'd it.

Output of reprex(mean(rnorm(3))):


Created by the reprex package; 2017-10-11

mean(rnorm(3))
#> [1] 0.3626104

jennybc added a commit that referenced this issue Oct 12, 2017

@jennybc

This comment has been minimized.

Member

jennybc commented Oct 12, 2017

Or I could stick it at the top of the body, i.e. do exactly what you have above.

Alternative output of reprex(mean(rnorm(3))):


reprex::reprex_info()
#> Created by the reprex package; 2017-10-11

mean(rnorm(3))
#> [1] -1.212095
@hadley

This comment has been minimized.

Member

hadley commented Oct 12, 2017

I think I still prefer the second form. Maybe also include reprex's version number?

@jennybc

This comment has been minimized.

Member

jennybc commented Oct 12, 2017

OK here's where we ended up. reprex(mean(rnorm(3))) yields this:

reprex::reprex_info()
#> Created by the reprex package v0.1.1.9000 on 2017-10-12

mean(rnorm(3))
#> [1] -0.02475685

@jennybc jennybc closed this in 0bfa606 Oct 12, 2017

@jennybc jennybc reopened this Nov 7, 2017

@jennybc

This comment has been minimized.

Member

jennybc commented Nov 7, 2017

Summarizing recent ideas from Slack convo:

  • Move to bottom?
  • Find an attractive way to include the output from reprex::reprex_info() but not the code. Details tag? Generate prose for a Markdown link, e.g., Created by the [reprex package](https://cran.r-project.org/package=reprex).
  • Put date in front of package version (not all agree on this): Run on 2017-11-06 with reprex (v0.1.1.900)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment