Re: [R] Condition warning: has length > 1 and only the first element will be used

2008-10-15 Thread Peter Dalgaard
Joe Kaser wrote: Thanks for the help. ifelse does the job. Could you elaborate, or give an example of the "awkward" things ifelse might do to classed objects? It strips the class. One thing that usually gets me is this: > dd <- as.Date(c("2008-1-2","2007-3-21")) > ifelse(dd>as.Date("2008-1-

Re: [R] Condition warning: has length > 1 and only the first element will be used

2008-10-15 Thread Joe Kaser
r > Intermountain Healthcare > [EMAIL PROTECTED] > 801.408.8111 > > > > -Original Message- > > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] > > project.org] On Behalf Of Joe Kaser > > Sent: Wednesday, October 15, 2008 2:19 PM > > To: r-help@r-project.o

Re: [R] Condition warning: has length > 1 and only the first element will be used

2008-10-15 Thread Joe Kaser
Thanks for the help. ifelse does the job. Could you elaborate, or give an example of the "awkward" things ifelse might do to classed objects? On Wed, Oct 15, 2008 at 1:38 PM, Peter Dalgaard <[EMAIL PROTECTED]>wrote: > Joe Kaser wrote: > >> Hello, >> >> I've been learning R functions recently and

Re: [R] Condition warning: has length > 1 and only the first element will be used

2008-10-15 Thread Peter Dalgaard
Joe Kaser wrote: Hello, I've been learning R functions recently and I've come across a problem that perhaps someone could help me with. # I have a a chron() object of times hours=chron(time=c("01:00:00","18:00:00","13:00:00","10:00:00")) # I would like to subtract 12 hours from each time el

Re: [R] Condition warning: has length > 1 and only the first element will be used

2008-10-15 Thread Greg Snow
> -Original Message- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] > project.org] On Behalf Of Joe Kaser > Sent: Wednesday, October 15, 2008 2:19 PM > To: r-help@r-project.org > Subject: [R] Condition warning: has length > 1 and only the first > element will be

[R] Condition warning: has length > 1 and only the first element will be used

2008-10-15 Thread Joe Kaser
Hello, I've been learning R functions recently and I've come across a problem that perhaps someone could help me with. # I have a a chron() object of times > hours=chron(time=c("01:00:00","18:00:00","13:00:00","10:00:00")) # I would like to subtract 12 hours from each time element, so I created