Re: [R] data frame manipulation with zero rows

2010-06-02 Thread Hadley Wickham
!! if (nrow(futures)==0) futures-data.frame(...) -Original Message- From: Peter Ehlers [mailto:ehl...@ucalgary.ca] Sent: Tuesday, June 01, 2010 12:07 PM To: arnaud Gaboury Cc: 'Prof Brian Ripley'; r-help@r-project.org Subject: Re: [R] data frame manipulation with zero rows On 2010

Re: [R] data frame manipulation with zero rows

2010-06-02 Thread arnaud Gaboury
Subject: Re: [R] data frame manipulation with zero rows On 2010-06-01 1:53, arnaud Gaboury wrote: Brian, If I do understand correctly, I must use in my function something else than ddply() if I want to avoid any error each time my df has zero rows? Am I correct? You could

[R] data frame manipulation with zero rows

2010-06-01 Thread arnaud Gaboury
Dear group, Here is the kind of data.frame I obtain every day with my function : futures - structure(list(DESCRIPTION = c(CORN Jul/10, CORN Jul/10, CORN Jul/10, CORN Jul/10, CORN Jul/10, LIVE CATTLE Aug/10, LIVE CATTLE Aug/10, SUGAR NO.11 Jul/10, SUGAR NO.11 Jul/10, SUGAR NO.11 Jul/10, SUGAR

Re: [R] data frame manipulation with zero rows

2010-06-01 Thread arnaud Gaboury
To: arnaud Gaboury Subject: Re: [R] data frame manipulation with zero rows On Tue, 1 Jun 2010, arnaud Gaboury wrote: Dear group, Here is the kind of data.frame I obtain every day with my function : futures - structure(list(DESCRIPTION = c(CORN Jul/10, CORN Jul/10, CORN Jul/10

Re: [R] data frame manipulation with zero rows

2010-06-01 Thread Peter Ehlers
01, 2010 9:47 AM To: arnaud Gaboury Subject: Re: [R] data frame manipulation with zero rows On Tue, 1 Jun 2010, arnaud Gaboury wrote: Dear group, Here is the kind of data.frame I obtain every day with my function : futures- structure(list(DESCRIPTION = c(CORN Jul/10, CORN Jul/10, CORN Jul/10

Re: [R] data frame manipulation with zero rows

2010-06-01 Thread Prof Brian Ripley
of zero rows: it may or may not be the one in package plyr. -Peter Ehlers -Original Message- From: Prof Brian Ripley [mailto:rip...@stats.ox.ac.uk] Sent: Tuesday, June 01, 2010 9:47 AM To: arnaud Gaboury Subject: Re: [R] data frame manipulation with zero rows On Tue, 1 Jun 2010

Re: [R] data frame manipulation with zero rows

2010-06-01 Thread arnaud Gaboury
It is indeed ddply() from package plyr. -Original Message- From: Prof Brian Ripley [mailto:rip...@stats.ox.ac.uk] Sent: Tuesday, June 01, 2010 12:24 PM To: Peter Ehlers Cc: arnaud Gaboury; r-help@r-project.org Subject: Re: [R] data frame manipulation with zero rows On Tue, 1

Re: [R] data frame manipulation with zero rows

2010-06-01 Thread arnaud Gaboury
Brian Ripley'; r-help@r-project.org Subject: Re: [R] data frame manipulation with zero rows On 2010-06-01 1:53, arnaud Gaboury wrote: Brian, If I do understand correctly, I must use in my function something else than ddply() if I want to avoid any error each time my df has zero rows? Am