Displaying 1 result from an estimated 1 matches for "mysplit1".
Did you mean:
mysplit
2012 Jun 06
3
problem about set operation and computation after split
...r/repeat/while).
What's this simple function's name ?
2.how to do a relative computation after split (notice: not befor split)?
create data:
myData1 <- data.frame(product = c(1,2,3,1,2,3),
year=c(2009,2009,2009,2010,2010,2010),value=c(1104,608,606,1504,508,1312),relative=0)
mySplit1<- split(myData1,myData1$year)
mySplit1
$`2009`
product year value relative
1 1 2009 1104 0
2 2 2009 608 0
3 3 2009 606 0
$`2010`
product year value relative
4 1 2010 1504 0
5 2 2010 508 0
6 3 2010 1312...