Re: [R] BUG: atan(1i) / 5 = NaN+Infi ?

2024-09-13 Thread Jonathan Dushoff
On Fri, Sep 13, 2024 at 1:10 PM Duncan Murdoch wrote: > [You don't often get email from murdoch.dun...@gmail.com. Learn why this is > important at https://aka.ms/LearnAboutSenderIdentification ] > Caution: External email. > On 2024-09-13 8:53 a.m., Jonathan Dushoff wrote

Re: [R] BUG: atan(1i) / 5 = NaN+Infi ?

2024-09-13 Thread Jonathan Dushoff
> Message: 4 > Date: Thu, 12 Sep 2024 11:21:02 -0400 > From: Duncan Murdoch > That's not the correct formula, is it? I think the result should be x * > Conj(y) / Mod(y)^2 . Correct, sorry. And thanks. > So that would involve * and > / , not just real arithmetic. Not an expert, but I don't s

[R] Subject: Re: BUG: atan(1i) / 5 = NaN+Infi ?

2024-09-12 Thread Jonathan Dushoff
> In this case, I do think we should look into the consequences of > indeed distinguishing >* >* and >/ > from their respective current {1. coerce to complex, 2. use complex arith} > arithmetic. I'm wondering whether – if this indeed gets opened up – it might also make sense to cal

Re: [R] Confusing behaviour in data.table: unexpectedly changing variable

2013-09-25 Thread Jonathan Dushoff
Thanks for your help, and sorry for mis-posting. JD On Wed, Sep 25, 2013 at 3:18 AM, Matthew Dowle wrote: > Very sorry to hear this bit you. If you need a copy of names before > changing them by reference : > oldnames <- copy(names(DT)) > This will be documented and it's on the bug list

[R] Confusing behaviour in data.table: unexpectedly changing variable

2013-09-24 Thread Jonathan Dushoff
I got bitten badly when a variable I created for the purpose of recording an old set of names changed when I didn't think I was going near it. I'm not sure if this is a desired behaviour, or documented, or warned about. I read the data.table intro and the FAQ, and also ?setnames. Ben Bolker crea

Re: [R] Selecting the "non-attribute" part of an object

2012-11-15 Thread Jonathan Dushoff
all.equal(m,mm,check.attributes=FALSE) > gives TRUE!!! I.e. sometimes attributes really are vital characteristics. > cheers, > Rolf Turner > On 16/11/12 08:52, Jonathan Dushoff wrote: >> I have two matrices, generated by R functions that I don't understa

[R] Selecting the "non-attribute" part of an object

2012-11-15 Thread Jonathan Dushoff
I have two matrices, generated by R functions that I don't understand. I want to confirm that they're the same, but I know that they have different attributes. If I want to compare the dimnames, I can say > identical(attr(tm, "dimnames"), attr(tmm, "dimnames")) [1] FALSE or even: > identical(d

[R] Subsetting without partial matches

2009-01-31 Thread Jonathan Dushoff
David: Thank you for your very valuable response. In fact, I was trying to _avoid_ partial matching, not accomplish it. Subset is a _much_ better way of doing what I was trying to do. Humorously, however, your code also reproduces the mistake that brought me here, AFAICT. I think my code

[R] Subsetting without partial matches

2009-01-30 Thread Jonathan Dushoff
I have a list of observations of individuals. I would like to make a list of individuals, with a data frame of observations for each individual. The following code usually works, but not always -- # Make a list of empty data