From @purd|e@@ @end|ng |rom gm@||@com  Fri May 17 07:09:09 2019
From: @purd|e@@ @end|ng |rom gm@||@com (Abby Spurdle)
Date: Fri, 17 May 2019 17:09:09 +1200
Subject: [Rd] nrow(rbind(character(),
 character())) returns 2 (as documented but very unintuitive, IMHO)
In-Reply-To: <CAD4oTHFjq3YvMTFrvufAXMgFy6YOwrSoCya8y5NkjsoNm9n-wQ@mail.gmail.com>
References: <CAD4oTHFE9SUD2nrfLqoppBQv9QgQV2sA_qo9XA9JwuD+oRdz3g@mail.gmail.com>
 <d01d8909-39b0-0281-96f7-8a897e7d1a7a@fredhutch.org>
 <CAD4oTHFjq3YvMTFrvufAXMgFy6YOwrSoCya8y5NkjsoNm9n-wQ@mail.gmail.com>
Message-ID: <CAB8pepxNQxuqzuZUqTSqxcyD2kG9xmgyvv2ne72=o3OD2Wo=eQ@mail.gmail.com>

Herve Pages wrote:

> In my experience, and more generally speaking, the desire to treat
> 0-length vectors as a special case that deviates from the
> non-zero-length case has never been productive.

Good idea.

Gabriel Becker Wrote:

> > nrow(rbind(aa = c("a", "b", "c"), AA = character()))
> [1] 1

> By rights of the invariance that you and Hadley are advocating,  as far as
> I understand it, the last should give 2 rows, one of which is all NAs,
> rather than giving only one row as it currently does (and, I assume?,
> always has).

I think, ideally, this example should generate an error or a warning.

	[[alternative HTML version deleted]]



[Rd] nrow(rbind(character(), character())) returns 2 (as documented but very unintuitive, IMHO)
Abby Spurdle