[R] test whether all elements of a vector are identical
baptiste.auguie at googlemail.com
Thu Dec 16 15:56:59 CET 2010
The fastest way seems to be,
all(x == x)
On 16 December 2010 15:17, Jannis <bt_jannis at yahoo.de> wrote:
> Dear list,
> this might be an easy one, but I could figure out a solution (or how to
> google the right term).
> Is there any way to test whether all elements of a vector are identical?
> For numeric vectors I would use
> but I have character vectors. Any Ideas?
> R-help at r-project.org mailing list
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
More information about the R-help