Displaying 2 results from an estimated 2 matches for "rep_each".
2014 Mar 23
1
A rep_each function
...t: it takes a bit of effort to learn (and remember) its syntax.
This is a problem, since rep is one of the first functions many
beginners will come across. Of the three main uses of rep, two have
simpler alternatives.
rep(x, times = ) has rep.int
rep(x, length.out = ) has rep_len
I think that a rep_each function would be a worthy addition for the
third use case
rep(x, each = )
(It might also be worth having rep_times as a synonym for rep.int.)
While this could go in a package, since one of its main benefits is to
help beginners, I feel it ought to go in base R.
Before I submit this as a featur...
2014 Mar 26
2
R-devel Digest, Vol 133, Issue 23
...d remember) its syntax.
> This is a problem, since rep is one of the first functions many
> beginners will come across. Of the three main uses of rep, two have
> simpler alternatives.
>
> rep(x, times = ) has rep.int
> rep(x, length.out = ) has rep_len
>
> I think that a rep_each function would be a worthy addition for the
> third use case
>
> rep(x, each = )
>
> (It might also be worth having rep_times as a synonym for rep.int.)
I think this is exactly the wrong approach. Indeed, the aim should be
to get rid of functions like rep.int (or at least discour...