Displaying 1 result from an estimated 1 matches for "ob_group".
Did you mean:
wb_group
2009 Jul 09
2
How to Populate List
...able to
leverage the fact that in my data files everything to the right is
also an observation to easily create list to the end of the row. Try
the following:
X<-data.frame(A=1:10, B=0, C=1, Ob1=1:10, Ob2=2:11, Ob3=3:12,Ob4=4:13,
Ob5=3:12, Ob6=2:11)
BrkPnt<-match("Ob1",names(X))
Ob_Group <- list(names(X)[BrkPnt:ncol(X)])
# Give to reshape to turn ObX into time
answerX1<- reshape(X, varying=Ob_Group, direction='long')
and at this point I can subset based on id or some other variable:
subset(answerX1, A==1)
A B C time Ob1 id
1.1 1 0 1 1 1 1
1.2 1 0 1 2 ...