[R] Empty Data Frame

Hadley Wickham hadley at rice.edu
Wed Apr 27 16:17:55 CEST 2011


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/



More information about the R-help mailing list