Re: [R] identical() versus sapply()

2016-04-08 Thread Jeff Newmiller
I highly recommend making friends with the str function. Try str( 1 ) str( 1:2 ) for the clue you need, and then sapply( 1:2, identical, 1L ) -- Sent from my phone. Please excuse my brevity. On April 8, 2016 3:24:31 PM PDT, "Paulson, Ariel" wrote: >Sorry if this has been answered elsewhere,

[R] identical() versus sapply()

2016-04-08 Thread Paulson, Ariel
Sorry if this has been answered elsewhere, but I can't find any discussion of it. Wondering why the following situation occurs (duplicated on 3.2.2 CentOS6 and 3.0.1 Win2k, so I don't think it is a bug): > sapply(1, identical, 1) [1] TRUE > sapply(1:2, identical, 1) [1] FALSE FALSE > sapply(1

Re: [R] identical applied to data frames

2014-04-06 Thread Rolf Turner
On 07/04/14 02:00, Rguy wrote: I have two data frames that I believe are identical, yet checking them with identical() fails. Each data frame has two columns named 'pk' and 'newv_f13__bool'. As shown below, the columns of the data frames are identical, according to the identical() function, yet

Re: [R] identical applied to data frames

2014-04-06 Thread David Winsemius
On Apr 6, 2014, at 7:00 AM, Rguy wrote: I have two data frames that I believe are identical, yet checking them with identical() fails. Each data frame has two columns named 'pk' and 'newv_f13__bool'. As shown below, the columns of the data frames are identical, according to the identical(

[R] identical applied to data frames

2014-04-06 Thread Rguy
I have two data frames that I believe are identical, yet checking them with identical() fails. Each data frame has two columns named 'pk' and 'newv_f13__bool'. As shown below, the columns of the data frames are identical, according to the identical() function, yet the data frames themselves are no

[R] identical() function issue on R when built with ICC, ICL

2013-05-28 Thread Beto .
Hello Guys, I am trying to build R using the Intel compilers: ICC, ICPC. The first time I ran the built I got the error below: mlutils.c(107): error: floating-point operation result is out of range double NA_REAL = ML_NAN; ^ mlutils.c(108): error: floating-point operation re

Re: [R] identical matrices

2012-11-18 Thread R. Michael Weylandt
Please stop posting and re-posting the same questions. Michael On Sunday, November 18, 2012, Haris Rhrlp wrote: > Dear R users, > > > I want to check matrices when i change the order of the rows or/and the > order of the columns or/and the combination of them > > i will give an example what i wa

[R] identical matrices

2012-11-18 Thread Haris Rhrlp
Dear R users, I want to check matrices when i change the order of the rows or/and the order of the columns or/and the combination of them i will give an example what i want  1  -1  1  1  1  1   1  1 -1  -1 -1 -1    -1 -1  -1  -1   1  1    1  1 1 -1    1   1 these 2 matrices are iden

Re: [R] identical function names from 2 packages

2011-05-20 Thread baptiste auguie
I imagine mind_read() easy to implement with Robin Hankin's emulator package -- under some weak assumptions about the user; mind_write(), however, seems more involved and might require investing in new hardware. Best, baptiste On 21 May 2011 12:04, Rolf Turner wrote: > > On reflection, it seems

Re: [R] identical function names from 2 packages

2011-05-20 Thread Rolf Turner
On reflection, it seems to me that what we really need here is Prof. Ripley's mind_read() function that was foreshadowed some years ago (see fortune("mind_read")) so that R could determine just *which* lm() (for example) function the user has in mind when he or she types ``lm(...)'' at the keyboa

Re: [R] identical function names from 2 packages

2011-05-20 Thread Greg Snow
ntermountain Healthcare greg.s...@imail.org 801.408.8111 > -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-bounces@r- > project.org] On Behalf Of Rolf Turner > Sent: Friday, May 20, 2011 1:29 AM > To: Jari Oksanen > Cc: r-h...@stat.math.ethz.ch > Subj

Re: [R] identical function names from 2 packages

2011-05-20 Thread Janko Thyson
Thanks for the info. I think I've tried that a while ago, but IIRCC, the problem was always that R won't let me create on object that would pass as a full grown NAMESPACE object. > foo <- function(x) print(x) > assignInNamespace(x="foo", value=foo, ns="testNS") Fehler in loadNamespace(name) :

Re: [R] identical function names from 2 packages

2011-05-20 Thread Barry Rowlingson
On Fri, May 20, 2011 at 9:16 AM, Janko Thyson wrote: > Yet, IMHO there will be more and more problems regarding this in the > future as the number of contributed packages keeps growing. I personally > would not mind at all to get used to typing 'thePackage::foo()' *all* > the time, or at least ha

Re: [R] identical function names from 2 packages

2011-05-20 Thread Janko Thyson
Hi, I encounter similar problems as well and posted a while ago about this. Namespaces are cool, but isn't it very much up to a package's position in the search path (which is quite arbitrary depending on the packages loaded) that determines which namespace "dominates"? That leaves it to the u

Re: [R] identical function names from 2 packages

2011-05-20 Thread Rolf Turner
My understanding (which is pretty shaky when it comes to namespaces) is that if you have things set up correctly then namespaces will make sure that function calls within functions in the given package will be to be to functions in that package and not to their doppelgangers in other packages whi

Re: [R] identical function names from 2 packages

2011-05-19 Thread Jari Oksanen
Duncan Murdoch gmail.com> writes: > > On 18/05/2011 10:02 PM, Nick Matzke wrote: > > Hi, > > > > If I load 2 packages that have a function with the same > > name, how do I tell R to run one or the other? > > > > If you are using a package without a namespace, expect problems. Having > the na

Re: [R] identical function names from 2 packages

2011-05-19 Thread Duncan Murdoch
On 18/05/2011 10:02 PM, Nick Matzke wrote: Hi, If I load 2 packages that have a function with the same name, how do I tell R to run one or the other? (Instead of having R automatically use the first- or last-loaded one, whichever it is. (Which is it, by the way.)) Cheers! Nick It is the m

Re: [R] identical function names from 2 packages

2011-05-18 Thread Nick Matzke
Thanks!! Nick On 5/18/11 7:06 PM, Ista Zahn wrote: Hi Nick, See ?"::" Best, Ista On Wed, May 18, 2011 at 10:02 PM, Nick Matzke wrote: Hi, If I load 2 packages that have a function with the same name, how do I tell R to run one or the other? (Instead of having R automatically use the first-

Re: [R] identical function names from 2 packages

2011-05-18 Thread Ista Zahn
Hi Nick, See ?"::" Best, Ista On Wed, May 18, 2011 at 10:02 PM, Nick Matzke wrote: > Hi, > > If I load 2 packages that have a function with the same name, how do I tell > R to run one or the other? > > (Instead of having R automatically use the first- or last-loaded one, > whichever it is.  (Whi

Re: [R] identical function names from 2 packages

2011-05-18 Thread Scott Chamberlain
Is it not something like? package1::myfunction package2::myfunction On Wednesday, May 18, 2011 at 9:02 PM, Nick Matzke wrote: > Hi, > > If I load 2 packages that have a function with the same > name, how do I tell R to run one or the other? > > (Instead of having R automatically use the first

[R] identical function names from 2 packages

2011-05-18 Thread Nick Matzke
Hi, If I load 2 packages that have a function with the same name, how do I tell R to run one or the other? (Instead of having R automatically use the first- or last-loaded one, whichever it is. (Which is it, by the way.)) Cheers! Nick -- ==

Re: [R] identical values not so identical? newbie help please!

2011-03-10 Thread Berwin A Turlach
G'day Maja, On Thu, 10 Mar 2011 11:44:28 -0800 (PST) maiya wrote: > Aaah, it truly is wonderful, this technology! > I guess I'm going to have to override it a bit though.. > Along the lines of > > tae <- ifesle(all.equal(obs, exp) == TRUE, 0, sum(abs(obs - exp))) Please read the help page on

Re: [R] identical values not so identical? newbie help please!

2011-03-10 Thread maiya
Quite fascinating, if annoying. Nice example Petr! Turns out my expected values are causing even more trouble because of this! I've even gotten negative chi square values (calculated using Cressie and Read's formula)! So instead of kludging the error measurement code, I think I'm going to have t

Re: [R] identical values not so identical? newbie help please!

2011-03-10 Thread maiya
Aaah, it truly is wonderful, this technology! I guess I'm going to have to override it a bit though.. Along the lines of tae <- ifesle(all.equal(obs, exp) == TRUE, 0, sum(abs(obs - exp))) Do I like doing this? No. But short of reading the vast literature that exists on calculation precision - wh

Re: [R] identical values not so identical? newbie help please!

2011-03-10 Thread Petr Savicky
On Thu, Mar 10, 2011 at 10:34:21AM -0800, maiya wrote: > Thanks Josh and Dan! > > I did figure it had something to do with the machine epsilon... > > But so what do I do now? I'm calculating the total absolute error over > thousands of tables e.g.: > tae<-sum(abs(obs-exp)) > Is there any easy way

Re: [R] identical values not so identical? newbie help please!

2011-03-10 Thread Nordlund, Dan (DSHS/RDA)
elp-bounces@r- > project.org] On Behalf Of maiya > Sent: Thursday, March 10, 2011 10:34 AM > To: r-help@r-project.org > Subject: Re: [R] identical values not so identical? newbie help please! > > Thanks Josh and Dan! > > I did figure it had something to do with the machine

Re: [R] identical values not so identical? newbie help please!

2011-03-10 Thread David A. Johnston
The function all.equal also might be helpful. See the help page. >help(all.equal) -David Johnston -- View this message in context: http://r.789695.n4.nabble.com/identical-values-not-so-identical-newbie-help-please-tp3346078p3346581.html Sent from the R help mailing list archive at Nabble.com.

Re: [R] identical values not so identical? newbie help please!

2011-03-10 Thread Joshua Wiley
On Thu, Mar 10, 2011 at 10:34 AM, maiya wrote: > Thanks Josh and Dan! > > I did figure it had something to do with the machine epsilon... > > But so what do I do now? I'm calculating the total absolute error over > thousands of tables e.g.: > tae<-sum(abs(obs-exp)) > Is there any easy way to I kee

Re: [R] identical values not so identical? newbie help please!

2011-03-10 Thread maiya
Thanks Josh and Dan! I did figure it had something to do with the machine epsilon... But so what do I do now? I'm calculating the total absolute error over thousands of tables e.g.: tae<-sum(abs(obs-exp)) Is there any easy way to I keep these ignorable errors from showing up? And furthermore, wh

Re: [R] identical values not so identical? newbie help please!

2011-03-10 Thread Joshua Wiley
Hi Maja, Values that are theoretically the same may not be exactly identical when using floating point arithmetic. Please read this FAQ page: http://cran.r-project.org/doc/FAQ/R-FAQ.html#Why-doesn_0027t-R-think-these-numbers-are-equal_003f If you need to test that they are "equal", you may add

Re: [R] identical values not so identical? newbie help please!

2011-03-10 Thread Nordlund, Dan (DSHS/RDA)
> -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-bounces@r- > project.org] On Behalf Of maiya > Sent: Thursday, March 10, 2011 7:19 AM > To: r-help@r-project.org > Subject: [R] identical values not so identical? newbie help please! > > Hi

[R] identical values not so identical? newbie help please!

2011-03-10 Thread maiya
Hi there! I'm not sure I can create a minimal example of my problem, so I'm linking to a minimal .RData file that has only two objects: obs and exp, each is a 6x9 matrix. http://dl.dropbox.com/u/10364753/test.RData link to dropbox file (I hope this is acceptable mailing list etiquette!) Here's

Re: [R] identical()

2010-08-16 Thread Jorge Ivan Velez
> a > a b > 2 10011048 L > 4 10011048 R > 6 10011049 L > 8 10011049 R > > b > a b > 1 10011048 L > 3 10011048 R > 5 10011049 L > 7 10011049 R > > > identical(a,b) > [1] FALSE > > some information about the attributes of the 2 data frames

Re: [R] identical()

2010-08-16 Thread Wu Gong
t; identical(a,b) [1] TRUE Regards, Wu array chip wrote: > >> a > a b > 2 10011048 L > 4 10011048 R > 6 10011049 L > 8 10011049 R >> b > a b > 1 10011048 L > 3 10011048 R > 5 10011049 L > 7 10011049 R > >> identical(a,b) >

Re: [R] identical()

2010-08-16 Thread array chip
Oops, I overlooked the row names. Sorry for my carelessness. Thanks - Original Message From: Erik Iverson To: array chip Cc: r-h...@stat.math.ethz.ch Sent: Mon, August 16, 2010 2:53:37 PM Subject: Re: [R] identical() Hello, array chip wrote: > Hi, I am really puzzled by t

Re: [R] identical()

2010-08-16 Thread Gabor Grothendieck
rns FALSE. > >> a >         a b > 2 10011048 L > 4 10011048 R > 6 10011049 L > 8 10011049 R >> b >         a b > 1 10011048 L > 3 10011048 R > 5 10011049 L > 7 10011049 R > >> identical(a,b) > [1] FALSE > > some information about the attribu

Re: [R] identical()

2010-08-16 Thread Erik Iverson
048 R 6 10011049 L 8 10011049 R b a b 1 10011048 L 3 10011048 R 5 10011049 L 7 10011049 R identical(a,b) [1] FALSE Do these really look "exactly the same" to you? The first column (the row.names) are clearly different, thus they are not identical. See ?row.names some in

[R] identical()

2010-08-16 Thread array chip
49 R > b a b 1 10011048 L 3 10011048 R 5 10011049 L 7 10011049 R > identical(a,b) [1] FALSE some information about the attributes of the 2 data frames: > class(a) [1] "data.frame" > class(b) [1] "data.frame" > class(a$a) [1] "integer" >

Re: [R] identical() mystery

2010-03-01 Thread DarioAustralia
Thanks for your suggestions. A couple of useful functions in there I haven't heard of before. -- View this message in context: http://n4.nabble.com/identical-mystery-tp1573269p1574379.html Sent from the R help mailing list archive at Nabble.com. __ R-

Re: [R] identical() mystery

2010-03-01 Thread Duncan Murdoch
Duncan Murdoch wrote: Dario Strbenac wrote: Hello, I have 2 vectors of the same mode and the same contents but I still get FALSE. Any ideas ? reference <- c(11, 14, 16, 5, 4, 2, 0, 15, 9, 0) reference [1] 11 14 16 5 4 2 0 15 9 0 cpgDensity

Re: [R] identical() mystery

2010-03-01 Thread jim holtman
If you use 'dput' you could provide a reproducible example, plus it would probably explain what was happening. On Mon, Mar 1, 2010 at 1:24 AM, Dario Strbenac wrote: > Hello, > > I have 2 vectors of the same mode and the same contents but I still get > FALSE. Any ideas ? > >> reference <- c(11, 1

Re: [R] identical() mystery

2010-03-01 Thread Duncan Murdoch
Dario Strbenac wrote: Hello, I have 2 vectors of the same mode and the same contents but I still get FALSE. Any ideas ? reference <- c(11, 14, 16, 5, 4, 2, 0, 15, 9, 0) reference [1] 11 14 16 5 4 2 0 15 9 0 cpgDensity [1] 11 14 16 5 4 2 0 15 9 0 identical

Re: [R] identical() mystery

2010-03-01 Thread Søren Højsgaard
ence,cpgDensity) [1] FALSE regards Søren Fra: r-help-boun...@r-project.org [r-help-boun...@r-project.org] På vegne af Dario Strbenac [d.strbe...@garvan.org.au] Sendt: 1. marts 2010 07:24 Til: r-help@r-project.org Emne: [R] identical() mystery Hello, I have 2 vectors of the sa

[R] identical() mystery

2010-03-01 Thread Dario Strbenac
Hello, I have 2 vectors of the same mode and the same contents but I still get FALSE. Any ideas ? > reference <- c(11, 14, 16, 5, 4, 2, 0, 15, 9, 0) > reference [1] 11 14 16 5 4 2 0 15 9 0 > cpgDensity [1] 11 14 16 5 4 2 0 15 9 0 > identical(cpgDensity, reference) [1] FALSE > mode

Re: [R] identical(length(x), 1) returns FALSE, but print(length(x)) is 1, length(x)==1 is TRUE, and is.integer(lenght(x)) is TRUE????

2009-09-15 Thread William Dunlap
Corrado > Cc: r-help@r-project.org; gavin.simp...@ucl.ac.uk > Subject: Re: [R] identical(length(x), 1) returns FALSE, but > print(length(x)) is 1, length(x)==1 is TRUE, and > is.integer(lenght(x)) is TRUE > > On Tue, 15 Sep 2009, Corrado wrote: > > > On Tuesday 15 Septemb

Re: [R] identical(length(x), 1) returns FALSE, but print(length(x)) is 1, length(x)==1 is TRUE, and is.integer(lenght(x)) is TRUE????

2009-09-15 Thread Gavin Simpson
On Tue, 2009-09-15 at 18:04 +0100, Corrado wrote: > On Tuesday 15 September 2009 17:28:02 Gavin Simpson wrote: > > [note you don't give us your x so I'm making this up - This is what > > Duncan was going on about in an earlier thread, give us something we can > > just paste into R and it works] >

Re: [R] identical(length(x), 1) returns FALSE, but print(length(x)) is 1, length(x)==1 is TRUE, and is.integer(lenght(x)) is TRUE????

2009-09-15 Thread Seeliger . Curt
Corrado writes: > I do not understand what more information! Take any vector of length 1, for > example x<-1. Plus all the command that where in my previous email > > What is the logic behind > > identical(length(x),1) > > being false? identical() returns FALSE because they are not iden

Re: [R] identical(length(x), 1) returns FALSE, but print(length(x)) is 1, length(x)==1 is TRUE, and is.integer(lenght(x)) is TRUE????

2009-09-15 Thread David Winsemius
On Sep 15, 2009, at 1:04 PM, Corrado wrote: On Tuesday 15 September 2009 17:28:02 Gavin Simpson wrote: [note you don't give us your x so I'm making this up - This is what Duncan was going on about in an earlier thread, give us something we can just paste into R and it works] Dear Gavin,

Re: [R] identical(length(x), 1) returns FALSE, but print(length(x)) is 1, length(x)==1 is TRUE, and is.integer(lenght(x)) is TRUE????

2009-09-15 Thread Thomas Lumley
On Tue, 15 Sep 2009, Corrado wrote: On Tuesday 15 September 2009 17:28:02 Gavin Simpson wrote: [note you don't give us your x so I'm making this up - This is what Duncan was going on about in an earlier thread, give us something we can just paste into R and it works] Dear Gavin, I do not und

Re: [R] identical(length(x), 1) returns FALSE, but print(length(x)) is 1, length(x)==1 is TRUE, and is.integer(lenght(x)) is TRUE????

2009-09-15 Thread Corrado
On Tuesday 15 September 2009 17:28:02 Gavin Simpson wrote: > [note you don't give us your x so I'm making this up - This is what > Duncan was going on about in an earlier thread, give us something we can > just paste into R and it works] Dear Gavin, I do not understand what more information! Take

Re: [R] identical(length(x), 1) returns FALSE, but print(length(x)) is 1, length(x)==1 is TRUE, and is.integer(lenght(x)) is TRUE????

2009-09-15 Thread Gavin Simpson
On Tue, 2009-09-15 at 17:28 +0100, Gavin Simpson wrote: > On Tue, 2009-09-15 at 17:16 +0100, Corrado wrote: > > Dear R, > > Are you really looking for all.equal()? > > > isTRUE(all.equal(length(x), 1)) > [1] TRUE Please ignore that bit of rubbish above, clearly that is not what is required or w

Re: [R] identical(length(x), 1) returns FALSE, but print(length(x)) is 1, length(x)==1 is TRUE, and is.integer(lenght(x)) is TRUE????

2009-09-15 Thread Gavin Simpson
On Tue, 2009-09-15 at 12:22 -0400, Steve Lianoglou wrote: > Hi, > I guess the lesson learned is that: > > identical() != == Indeed, and ?identical explains some of the motivation behind the function identical and the examples of said help page include the problem the OP faced... now where was t

Re: [R] identical(length(x), 1) returns FALSE, but print(length(x)) is 1, length(x)==1 is TRUE, and is.integer(lenght(x)) is TRUE????

2009-09-15 Thread Gavin Simpson
On Tue, 2009-09-15 at 17:16 +0100, Corrado wrote: > Dear R, > > the condition: > > identical(length(x),1) returns FALSE > > but > > print(length(x)) > > returns 1 and: > > is.vector(x) is TRUE. > is.integer(length(x)) is TRUE > length(x) ==1 is TRUE > > I am puzzled. The key is noticing t

Re: [R] identical(length(x), 1) returns FALSE, but print(length(x)) is 1, length(x)==1 is TRUE, and is.integer(lenght(x)) is TRUE????

2009-09-15 Thread Steve Lianoglou
Hi, On Sep 15, 2009, at 12:16 PM, Corrado wrote: Dear R, the condition: identical(length(x),1) returns FALSE but print(length(x)) returns 1 and: is.vector(x) is TRUE. is.integer(length(x)) is TRUE length(x) ==1 is TRUE I am puzzled. But is.integer(1) is FALSE and identical(length(x)

Re: [R] identical(length(x), 1) returns FALSE, but print(length(x)) is 1, length(x)==1 is TRUE, and is.integer(lenght(x)) is TRUE????

2009-09-15 Thread Uwe Ligges
Corrado wrote: Dear R, the condition: identical(length(x),1) returns FALSE but print(length(x)) returns 1 and: is.vector(x) is TRUE. is.integer(length(x)) is TRUE length(x) ==1 is TRUE I am puzzled. Regards > is.integer(length(x)) [1] TRUE > is.integer(1) [1] FALSE Hence: > iden

[R] identical(length(x), 1) returns FALSE, but print(length(x)) is 1, length(x)==1 is TRUE, and is.integer(lenght(x)) is TRUE????

2009-09-15 Thread Corrado
Dear R, the condition: identical(length(x),1) returns FALSE but print(length(x)) returns 1 and: is.vector(x) is TRUE. is.integer(length(x)) is TRUE length(x) ==1 is TRUE I am puzzled. Regards -- Corrado Topi Global Climate Change & Biodiversity Indicators Area 18,Department of Biology U

Re: [R] identical scales per panel with relation="free"

2008-04-16 Thread Deepayan Sarkar
On 4/16/08, Andreas Krause <[EMAIL PROTECTED]> wrote: > > Using xyplot, I am plotting observed versus predicted values conditional to > the values of a third variable. > I would thus like to have an aspect ratio of 1 and the same axis range. > Since the range of the values differs substantially

[R] identical scales per panel with relation="free"

2008-04-16 Thread Andreas Krause
Using xyplot, I am plotting observed versus predicted values conditional to the values of a third variable. I would thus like to have an aspect ratio of 1 and the same axis range. Since the range of the values differs substantially between panels, the axis ranges shall be different for each pane