From jono @end|ng |rom jc@rro||@com@@u  Wed Feb 20 13:39:07 2019
From: jono @end|ng |rom jc@rro||@com@@u (Jonathan Carroll)
Date: Wed, 20 Feb 2019 23:09:07 +1030
Subject: [Rd] make.unique rbind examples
In-Reply-To: <CAAjDRiiacrP1aa8fn+_AEzqfABRzVPbsPrW2gkdRS2VsQB0G4A@mail.gmail.com>
References: <CAAjDRiiacrP1aa8fn+_AEzqfABRzVPbsPrW2gkdRS2VsQB0G4A@mail.gmail.com>
Message-ID: <CAAjDRii+7Xeq_UfgQLuQmSGKebaj=0RU+Y-oKqkPZgB85csAMg@mail.gmail.com>

Entirely by coincidence I just now discovered that this issue was raised in
2013 [1] with similar suggestions for improvements. My search did not
initially uncover this message, so apologies for the repost which was
actually a nearly 16 year later "bump" posting.

[1] https://stat.ethz.ch/pipermail/r-devel/2013-May/066727.html

Regards,

- Jonathan.

On Mon, 11 Feb. 2019, 9:19 pm Jonathan Carroll, <jono at jcarroll.com.au>
wrote:

> The final two examples in ?make.unique do not appear to be relevant to
> that function, namely
>
> rbind(data.frame(x = 1), data.frame(x = 2), data.frame(x = 3))
> rbind(rbind(data.frame(x = 1), data.frame(x = 2)), data.frame(x = 3))
>
> both producing
>
>   x
> 1 1
> 2 2
> 3 3
>
> (identically) on R 3.4.3 and 3.5.1. Following a brief discussion on
> Twitter, Rich FitzJohn [1] identified that under R 1.8.0 (circa 2003,
> around the time these examples were added) the rownames for the output
> of these lines was c("1", "11", "12"). This suggests that perhaps the
> example was added to demonstrate behaviour which is no longer
> supported.
>
> A more relevant example might be
>
> data.frame(x = 1, x = 2, x = 3)
>
> producing
>
>   x x.1 x.2
> 1 1   2   3
>
> or, perhaps more in keeping with the original intention,
>
> rbind(data.frame(x = 1, row.names = "a"), data.frame(x = 2, row.names
> = "a"), data.frame(x = 3, row.names = "a"))
>
> producing output with rownames c("a", "a1", "a2").
>
> Regards,
>
> - Jonathan.
>
> [1] https://twitter.com/rgfitzjohn/status/1094885131532275712
>

	[[alternative HTML version deleted]]



[Rd] make.unique rbind examples
Jonathan Carroll