Re: [R] problem with all/all.equal

2011-04-13 Thread MacQueen, Don
Queen Lawrence Livermore National Laboratory 7000 East Ave., L-627 Livermore, CA 94550 925-423-1062 -Original Message- From: Laura Smith Date: Wed, 6 Apr 2011 15:09:14 -0700 To: "r-help@r-project.org" Subject: [R] problem with all/all.equal >Hi! > >In a function, I

Re: [R] problem with all/all.equal

2011-04-06 Thread Henrik Bengtsson
On Wed, Apr 6, 2011 at 9:23 PM, Joshua Wiley wrote: > Hi Laura, > > You have gotten several good suggestions.  Here are two more that may > be helpful if you have (or potentially could have) unruly data.  In > one case, the values are theoretically, but not computationally > identical.  In the oth

Re: [R] problem with all/all.equal

2011-04-06 Thread Joshua Wiley
Hi Laura, You have gotten several good suggestions. Here are two more that may be helpful if you have (or potentially could have) unruly data. In one case, the values are theoretically, but not computationally identical. In the other, missing values lead to NA being returned, which may be a pro

Re: [R] problem with all/all.equal

2011-04-06 Thread B77S
ifelse(length(unique(x))==1, "All Equal", "Not All Equal") -- View this message in context: http://r.789695.n4.nabble.com/problem-with-all-all-equal-tp3431956p3432167.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.or

Re: [R] problem with all/all.equal

2011-04-06 Thread Peter Langfelder
On Wed, Apr 6, 2011 at 3:09 PM, Laura Smith wrote: > Hi! > > In a function, I may have an instance in which all elements are equal. > >> x <- rep(1,5) >> >> x > [1] 1 1 1 1 1 >> identical(x) > Error in .Internal(identical(x, y, num.eq, single.NA, attrib.as.set)) : >  'y' is missing >> all.equal(x)

[R] problem with all/all.equal

2011-04-06 Thread Laura Smith
Hi! In a function, I may have an instance in which all elements are equal. > x <- rep(1,5) > > x [1] 1 1 1 1 1 > identical(x) Error in .Internal(identical(x, y, num.eq, single.NA, attrib.as.set)) : 'y' is missing > all.equal(x) Error in is.expression(x) : 'x' is missing > I don't care what par