Re: [R] Empty Data Frame

From: Hadley Wickham <hadley_at_rice.edu>
Date: Wed, 27 Apr 2011 09:17:55 -0500

On Wed, Apr 27, 2011 at 4:58 AM, Dennis Murphy <djmuser_at_gmail.com> wrote:
> Hi:
>
> You could try something like
>
> df <- data.frame( expand.grid( Week = 1:52, Year = 2002:2011 ))

expand.grid already returns a data frame... You might want KEEP.OUT.ATTRS = F though. Even it feels like you are yelling at R.

Hadley

-- 
Assistant Professor / Dobelman Family Junior Chair
Department of Statistics / Rice University
http://had.co.nz/

______________________________________________
R-help_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Received on Wed 27 Apr 2011 - 14:27:23 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Wed 27 Apr 2011 - 14:40:34 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive