Skip to content

Empty Data Frame

3 messages · Santosh Srinivas, Dennis Murphy, Hadley Wickham

#
Hi:

You could try something like

df <- data.frame( expand.grid( Week = 1:52, Year = 2002:2011 ))
dim(df)
head(df)

The first variable changes faster than the second.

HTH,
Dennis

On Wed, Apr 27, 2011 at 1:03 AM, Santosh Srinivas
<santosh.srinivas at gmail.com> wrote:
#
On Wed, Apr 27, 2011 at 4:58 AM, Dennis Murphy <djmuser at gmail.com> wrote:
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