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*

4
  • \$\begingroup\$ Very nice and quick! The rise of the R coder... \$\endgroup\$ Commented Mar 27, 2018 at 19:44
  • 2
    \$\begingroup\$ @Lembik I was lucky enough to have popped into TNB right in between you saying "I'm going to post this as a challenge" and you actually posting it. \$\endgroup\$ Commented Mar 27, 2018 at 19:55
  • 1
    \$\begingroup\$ Oh look "length[<-" will return too just like our favorite buddy "[<-". No bytes saved for less readability: function(L,b)colSums(matrix("length<-"(L,ceiling(length(L)/b)*b),,b),T) \$\endgroup\$ Commented Mar 27, 2018 at 20:46
  • 1
    \$\begingroup\$ @Vlo no bytes saved for less readability is probably the motto of R golfing...although I suppose that sum(L|1) is a byte saved from length(L)! \$\endgroup\$ Commented Mar 27, 2018 at 20:48