eddelbuettel,
@eddelbuettel@mastodon.social avatar

Dang. %||% coming to base R in R 4.4.0 next April.

jonny,
@jonny@neuromatch.social avatar

@eddelbuettel
Thats the whackiest ternary operator, I freaking love how whimsical R is.

dgkf,
@dgkf@fosstodon.org avatar

@eddelbuettel in what’s the best way to discover which features are under consideration? I often see these posts about new features when they’re added, but never posts about upcoming feature discussions. I’m curious why changes always feel like surprises.

eddelbuettel,
@eddelbuettel@mastodon.social avatar

@dgkf That is something you (or we all) would have to take up with R Core. I just report what I see at the useful RSS summary of changes to NEWS (update daily) and/or the github mirror of the SVN.

The lack of clear communication from either CRAN or R Core is not exactly new, and why we have things like these bots.

So in sum I guess your best bet to faster updates may be to become an R Core member to see their emails 🙃

dgkf,
@dgkf@fosstodon.org avatar

@eddelbuettel Gotcha. The answer I expected, but was hoping I had a blind spot. I really like following the enhancement proposals for other languages and would love to see that adopted in R land.

Thanks for reporting out when you see cool changes! Sounds like it’s the best we have for now.

hrbrmstr,
@hrbrmstr@mastodon.social avatar

@dgkf @eddelbuettel mebbe join the Slack group? https://contributor.r-project.org/

long covid cognition issues make it hard to me to context switch across multiple slacks so i’m not in there but i'd like to think there was some discussion there.

granted Slack is a closed info system, so not idea, but that may be a good path for answers in general.

ERDonnachie,

@eddelbuettel
Not sure how I feel about that, to be honest. Does that produce better, more concise code, or just add unnecessary added complexity.

teunbrand,
@teunbrand@fosstodon.org avatar

@ERDonnachie @eddelbuettel

To express the thought 'if A is null, then B; if B is also null, then C', the following:

A %||% B %||% C

Is easier to follow and more succinct than the alternatives:

if (is.null(A)) if (is.null(B)) C else B else A

or

if (!is.null(A)) A else if (!is.null(B)) B else if (!is.null(C)) C

johnmackintosh,
@johnmackintosh@fosstodon.org avatar

@teunbrand @ERDonnachie @eddelbuettel

Ah, so it's kind of like coalesce() then?
That will be quite handy, for sure

teunbrand,
@teunbrand@fosstodon.org avatar

@johnmackintosh @ERDonnachie @eddelbuettel Wasn't too familliar with coalesce() but that seems more like fill behaviour for vectors, whereas %||% is more of a non-vectorised, object-wise operation, if that makes sense.

Private
  • All
  • Subscribed
  • Moderated
  • Favorites
  • random
  • tester
  • magazineikmin
  • khanakhh
  • InstantRegret
  • thenastyranch
  • Youngstown
  • everett
  • mdbf
  • slotface
  • ngwrru68w68
  • DreamBathrooms
  • kavyap
  • osvaldo12
  • rosin
  • JUstTest
  • Durango
  • tacticalgear
  • modclub
  • cubers
  • GTA5RPClips
  • ethstaker
  • normalnudes
  • cisconetworking
  • Leos
  • megavids
  • provamag3
  • anitta
  • lostlight
  • All magazines