Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

2
  • 1
    \$\begingroup\$ 35 bytes; more generally, you can use the "header" field of TIO and put a f <- to assign the function. But still, nice solution, make sure you read Tips for golfing in R when you get a chance! \$\endgroup\$ Commented Oct 27, 2017 at 18:36
  • 1
    \$\begingroup\$ 31 bytes using Oliver Gregoire's formula \$\endgroup\$ Commented Oct 27, 2017 at 18:40