-
Notifications
You must be signed in to change notification settings - Fork 235
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
Add @examplesIf tag #993
Add @examplesIf tag #993
Conversation
551c94c
to
af24ea3
Compare
Has anything else changed that requires us to rethink this, or should I review it as is? |
@hadley Good as it is, well, except that it needs NEWS and docs, if we decide to go with this. FWIW I use it in several packages and seems to work well. |
If every line of code has its own foo <- TRUE
if (foo) "foo"
#> [1] "foo"
if (foo) if (TRUE) "bar" else "baz"
#> [1] "bar"
if (foo) if (FALSE) "bar" else "baz"
#> [1] "baz" Created on 2020-06-08 by the reprex package (v0.3.0) |
@krlmlr hmmm, it is no obvious to me that you can do that. E.g. how about multi-line strings? Or raw strings? You could parse the expression, but this is starting to get much more complicated than |
Got you. I thought this pattern is applied to every statement. In this case |
@krlmlr Thanks! |
Can you add a news bullet? I'd like to merge this just so we can experiment a bit more with it (without advertising it heavily) |
(Closed by mistake.) @hadley So, this version does not handle examples in R6 classes, which are special. It would need this commit to handle them: gaborcsardi/roxygenlabs@fc249f5 Should I add that? |
I think we should leave R6 for now |
@hadley Added NEWS bullet. |
Quite simple. Let me know what you think.
Closes #962.