[R] Empty Data Frame
djmuser at gmail.com
Wed Apr 27 11:58:31 CEST 2011
You could try something like
df <- data.frame( expand.grid( Week = 1:52, Year = 2002:2011 ))
The first variable changes faster than the second.
On Wed, Apr 27, 2011 at 1:03 AM, Santosh Srinivas
<santosh.srinivas at gmail.com> wrote:
> Dear Group,
> Is there a more efficient way to create a data frame structure (using rep I
> week <- rdply(10, data.frame(week = 1:52))
> names(week) <- c("Year", "Week")
> week$Year <- week$Year + 2000
> Basically trying to create a year and week data frame to start appending
> data to for a ggplot.
> Many thanks.
> [[alternative HTML version deleted]]
> R-help at r-project.org mailing list
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
More information about the R-help