[R] Logical operations or selecting data from data.frames

2007-01-09 Thread Benjamin Dickgiesser
Hi all, why doesn't something like this does not work? speedy - (sdata$VaR sdata$DdtdAbs) sdata$DdtdDuration = qpois(pct,lambda) sdata$Ddtd MinDD or sdata$Ddtd[sdata$Ddtd 0 sdata$VaR sdata$DdtdAbs] sdata looks like this: dataId date value Ddtd VaR

Re: [R] Logical operations or selecting data from data.frames

2007-01-09 Thread Benjamin Dickgiesser
I suppose this doesn't work for the same reason as sdata$VaR sdata$DdtdAbs sdata$DdtdDuration = 1 does only return FALSE and not a vector of TRUE and FALSE as sdata$VaR sdata$DdtdAbs would return. Is there a ways around this? Benjamin On 1/9/07, Benjamin Dickgiesser [EMAIL PROTECTED]

Re: [R] Logical operations or selecting data from data.frames

2007-01-09 Thread Johan Sandblom
Is the solution this simple? sdata$VaR sdata$DdtdAbs sdata$DdtdDuration = 1 Regards, Johan 2007/1/9, Benjamin Dickgiesser [EMAIL PROTECTED]: I suppose this doesn't work for the same reason as sdata$VaR sdata$DdtdAbs sdata$DdtdDuration = 1 does only return FALSE and not a vector of TRUE

Re: [R] Logical operations or selecting data from data.frames

2007-01-09 Thread Roger Bivand
On Tue, 9 Jan 2007, Benjamin Dickgiesser wrote: I suppose this doesn't work for the same reason as sdata$VaR sdata$DdtdAbs sdata$DdtdDuration = 1 does only return FALSE and not a vector of TRUE and FALSE as See ?: '' and '' indicate logical AND and '|' and '||' indicate

Re: [R] Logical operations or selecting data from data.frames

2007-01-09 Thread Benjamin Dickgiesser
Thx for the help, sorry I am just used to use from php and simply assumed it would work identically. On 1/9/07, Patrick Burns [EMAIL PROTECTED] wrote: S Poetry (and other documentation) will tell you the difference between '' and ''. Patrick Burns [EMAIL PROTECTED] +44 (0)20 8525 0696