Displaying 3 results from an estimated 3 matches for "r2007".
Did you mean:
2007
2008 Aug 08
2
Length of data.frame column
I have a beginner question. After I finally get the data to a data.frame that I can work with I have the following a data frame that is fairly long:
> length(r2007)
[1] 17409
If I look at the first element:
> r2007[1]
$`100009`
DayOfYear Quantity
1 66 1
2 128 1
3 137 1
4 193 1
Now how do I get the length of this list (actually it is another data.frame)?
I have tried:
> length(r2007[1])
[1] 1
N...
2008 Aug 09
1
Reshape set operations?
...uot;,"SubCategory","Sku"), measure.var=c("Quantity"))
m2007 <- melt(t2007, id.var=c("DayOfYear","Category","SubCategory","Sku"), measure.var=c("Quantity"))
r2008 <- cast(m2008, DayOfYear ~ variable | Sku, sum)
r2007 <- cast(m2007, DayOfYear ~ variable | Sku, sum)
Now I would like to union the two lists. So I start out with an empty master list that will contain (when I am done) the merge (union) of r2008 and r2007. By "union" I mean that if the Sku exists in r2007 and r2008 I would like to create...
2008 Aug 27
1
Updating a list.
I have a list that is generated from the resape package function 'cast'. It consists of three columns, Sku, DayOfYear, variable it is generated like:
r2007 <- cast(m2008, DayOfYear ~ variable | Sku, sum)
Now DayOfYear can range from 1:365 but there are not necessarily that many rows in the list. What I want to do is make every row in the list of lenght 365 and have the values correspond to the sum of the DayOfYear in the list if present and 0 if n...